Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread.CellType Namespace / ComboBoxCellType Class / ListWidth Property
Example


In This Topic
    ListWidth Property (ComboBoxCellType)
    In This Topic
    Gets or sets the width (in pixels) of the drop-down list.
    Syntax
    'Declaration
     
    Public Property ListWidth As Integer
    'Usage
     
    Dim instance As ComboBoxCellType
    Dim value As Integer
     
    instance.ListWidth = value
     
    value = instance.ListWidth
    public int ListWidth {get; set;}

    Property Value

    Integer number of pixels for the width of the list box
    Remarks

    This sets the width of the drop-down list in pixels.

    The possible settings are summarized here:

    Setting Description
      0 Widest Item: The list becomes the width of the widest item.
     -1 Cell Width: The list becomes the width of the cell.
      n Pixel Width: Where n is any positive integer. The list becomes n number of pixels wide.     

    Example
    This example sets up a cell on the first sheet with a combo box with the first six months of the year and specifies the size of the portion displayed.
    FarPoint.Win.Spread.CellType.ComboBoxCellType cmbocell = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
    cmbocell.Items = (new String[] {"January", "February", "March", "April", "May", "June"});
    cmbocell.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.AllArrows;
    cmbocell.AutoSearch = FarPoint.Win.AutoSearch.SingleCharacter;
    cmbocell.Editable = true;
    cmbocell.ListAlignment = FarPoint.Win.ListAlignment.Left;
    cmbocell.ListOffset = 20;
    cmbocell.ListWidth = 0;
    cmbocell.MaxDrop = 4;
    fpSpread1.Sheets[1].Cells[2,2].CellType = cmbocell;
    Dim cmbocell As New FarPoint.Win.Spread.CellType.ComboBoxCellType()
    cmbocell.Items = (new String() {"January", "February", "March", "April", "May", "June"})
    cmbocell.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.AllArrows
    cmbocell.AutoSearch = FarPoint.Win.AutoSearch.SingleCharacter
    cmbocell.Editable = True
    cmbocell.ListAlignment = FarPoint.Win.ListAlignment.Left
    cmbocell.ListOffset = 20
    cmbocell.ListWidth = 0
    cmbocell.MaxDrop = 4
    fpSpread1.Sheets(1).Cells(2,2).CellType = cmbocell
    See Also