Spread Windows Forms 7.0 Product Documentation
ButtonDrawModes Enumeration
Example  See Also  Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace : ButtonDrawModes Enumeration


Glossary Item Box

Specifies how to display buttons in cells for button and combo box cell types.

Syntax

Visual Basic (Declaration) 
Public Enum ButtonDrawModes 
   Inherits System.Enum
Visual Basic (Usage)Copy Code
Dim instance As ButtonDrawModes
C# 
public enum ButtonDrawModes : System.Enum 

Members

MemberDescription
Always[0] Always displays buttons
AlwaysEditButtons[32] Always displays buttons for edit cells
AlwaysPrimaryButton[8] Always displays buttons for button cells
AlwaysSecondaryButton[16] Always displays buttons for combo box cells
CurrentCell[1] Displays buttons only in the current cell
CurrentColumn[2] Displays buttons only in the current column
CurrentRow[4] Displays buttons only in the current row

Remarks

For more information about buttons, refer to Allowing the Display of Buttons.

To more accurately limit where buttons are displayed in the spreadsheet, you may combine any subset of the settings using the OR operator - for Visual Basic, it's Or; for C# it's the pipe character (|).

The primary button is the button in a button cell type, where the cell itself is a button. The secondary buttons are the other secondary buttons in a cell, such as the drop-down buttons in a combo box cell or the spin buttons in a cell.

Example

C#Copy Code
FarPoint.Win.Spread.FpSpread fpSpread1 = new FarPoint.Win.Spread.FpSpread();
FarPoint.Win.Spread.SheetView shv = new FarPoint.Win.Spread.SheetView();
DialogResult dlg;
fpSpread1.Location = new Point(10, 10);
fpSpread1.Height = 200;
fpSpread1.Width = 400;
Controls.Add(fpSpread1);
fpSpread1.Sheets.Add(shv);
fpSpread1.ActiveSheet.Cells[0, 0].CellType = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
fpSpread1.ActiveSheet.Cells[1, 0].CellType = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
fpSpread1.ActiveSheet.Cells[1, 2].CellType = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
dlg = MessageBox.Show("Do you want to hide the button for the combo box in the third column??", "ButtonDrawMode", MessageBoxButtons.YesNo);
if (dlg == DialogResult.Yes)
{
     fpSpread1.ButtonDrawMode = FarPoint.Win.Spread.ButtonDrawModes.CurrentColumn;
}
Visual BasicCopy Code
Dim fpSpread1 As New FarPoint.Win.Spread.FpSpread()
Dim shv As New FarPoint.Win.Spread.SheetView()
Dim dlg As DialogResult
fpSpread1.Location = New Point(10, 10)
fpSpread1.Height = 200
fpSpread1.Width = 400
Controls.Add(fpSpread1)
fpSpread1.Sheets.Add(shv)
fpSpread1.ActiveSheet.Cells(0, 0).CellType = New FarPoint.Win.Spread.CellType.ComboBoxCellType()
fpSpread1.ActiveSheet.Cells(1, 0).CellType = New FarPoint.Win.Spread.CellType.ComboBoxCellType()
fpSpread1.ActiveSheet.Cells(1, 2).CellType = New FarPoint.Win.Spread.CellType.ComboBoxCellType()
dlg = MessageBox.Show("Do you want to hide the button for the combo box in the third column??", "ButtonDrawMode", MessageBoxButtons.YesNo)
If dlg = DialogResult.Yes Then
     fpSpread1.ButtonDrawMode = FarPoint.Win.Spread.ButtonDrawModes.CurrentColumn
End If

Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         FarPoint.Win.Spread.ButtonDrawModes

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.