Spread Windows Forms 17
GrapeCity.Win.PluginInputMan Assembly / GrapeCity.Win.Spread.InputMan.CellType Namespace / GcComboBoxCellType Class / ShowListBoxImage Property
Example


In This Topic
    ShowListBoxImage Property (GcComboBoxCellType)
    In This Topic
    Gets or sets whether to show the images of the drop-down list.
    Syntax
    'Declaration
     
    
    Public Property ShowListBoxImage As Boolean
    'Usage
     
    
    Dim instance As GcComboBoxCellType
    Dim value As Boolean
     
    instance.ShowListBoxImage = value
     
    value = instance.ShowListBoxImage
    public bool ShowListBoxImage {get; set;}

    Property Value

    A bool value, true to show images; otherwise, false .
    The default is false.
    Remarks
    An image is shown if this property is true and the ListItem.Image property is not a null reference (Nothing in Visual Basic).
    Example
    次のサンプルコードは、ドロップダウンリストに画像を追加します。
    ImageList img = new ImageList();
    img.Images.Add(Image.FromFile("C:\\Program Files (x86)\\GrapeCity\\Spread Studio\\Common\\CC logo.png"));
    img.Images.Add(Image.FromFile("C:\\Program Files (x86)\\GrapeCity\\Spread Studio\\Common\\clkEditor.jpg"));
    img.Images.Add(Image.FromFile("C:\\Program Files (x86)\\GrapeCity\\Spread Studio\\Common\\sd.ico"));
    
    GrapeCity.Win.Spread.InputMan.CellType.GcComboBoxCellType gccombo = new GrapeCity.Win.Spread.InputMan.CellType.GcComboBoxCellType();
    gccombo.Items.Add("Gouda");
    gccombo.Items.Add("Swiss");
    gccombo.Items.Add("Brie");
    gccombo.Items[0].BackColor = Color.Beige;
    gccombo.Items[1].BackColor = Color.Cornsilk;
    gccombo.Items[2].BackColor = Color.PeachPuff;
    gccombo.ImageList = img;
    gccombo.Items[0].Image = 0;
    gccombo.Items[1].Image = 1;
    gccombo.Items[2].Image = 2;
    gccombo.ShowListBoxImage = true;
    gccombo.ImageAlign = HorizontalAlignment.Right;
    gccombo.ImageWidth = 50;
    fpSpread1.Sheets[0].Cells[1, 1].CellType = gccombo;
    Dim img As New ImageList()
    img.Images.Add(Image.FromFile("C:\Program Files (x86)\GrapeCity\Spread Studio\Common\CC logo.png"))
    img.Images.Add(Image.FromFile("C:\Program Files (x86)\GrapeCity\Spread Studio\Common\clkEditor.jpg"))
    img.Images.Add(Image.FromFile("C:\Program Files (x86)\GrapeCity\Spread Studio\Common\sd.ico"))
    
    Dim gccombo As New GrapeCity.Win.Spread.InputMan.CellType.GcComboBoxCellType()
    gccombo.Items.Add("Gouda")
    gccombo.Items.Add("Swiss")
    gccombo.Items.Add("Brie")
    gccombo.Items(0).BackColor = Color.Beige
    gccombo.Items(1).BackColor = Color.Cornsilk
    gccombo.Items(2).BackColor = Color.PeachPuff
    gccombo.ImageList = img
    gccombo.Items(0).Image = 0
    gccombo.Items(1).Image = 1
    gccombo.Items(2).Image = 2
    gccombo.ShowListBoxImage = True
    gccombo.ImageAlign = HorizontalAlignment.Right
    gccombo.ImageWidth = 50
    FpSpread1.Sheets(0).Cells(1, 1).CellType = gccombo
    See Also