Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread Namespace / ButtonDrawModes Enumeration
Example Example


In This Topic
    ButtonDrawModes Enumeration
    In This Topic
    Specifies how to display buttons in cells for button and combo box cell types.
    Syntax
    'Declaration
     
    Public Enum ButtonDrawModes 
       Inherits System.Enum
    'Usage
     
    Dim instance As ButtonDrawModes
    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
    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;
    }
    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

    See Also