Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example specifies text for a combo box cell, makes the list editable, displays only three rows at a time, and sets the width to the length of the longest item in the list.

C++

// Specify a cell
m_Spread.SetCol(2);
m_Spread.SetRow(3);
// Define cell type as combo box
m_Spread.SetCellType(CellTypeComboBox);
// Specify text for the combo box
m_Spread.SetTypeComboBoxList ("Mastiff\tSheepdog\tTerrier\tSpaniel\tPointer\tCoonhound");
// Allow the user to edit the list
m_Spread.SetTypeComboBoxEditable(True);
// Set the number or rows to display
m_Spread.Set TypeComboBoxMaxDrop(3);
// Select the first item in the list
m_Spread.Set TypeComboBoxCurSel(0);
// Set the width to display the widest item in the list
m_Spread.Set TypeComboBoxWidth(1);

Visual Basic

' Specify a cell
fpSpread1.Row = 2
fpSpread1.Col = 2
' Define cell type as combo box
fpSpread1.CellType = CellTypeComboBox
' Specify text for the combo box
fpSpread1.TypeComboBoxList = "Mastiff" + Chr$(9) + "Sheepdog"+ Chr$(9) + "Terrier" + Chr$(9) + "Spaniel" + Chr$(9)+ "Pointer" + Chr$(9) + "Coonhound"
' Allow the user to edit the list
fpSpread1.TypeComboBoxEditable = True
' Set the number or rows to display
fpSpread1.TypeComboBoxMaxDrop = 3
' Select the first item in the list
fpSpread1.TypeComboBoxCurSel = 0
' Set the width to display the widest item in the list
fpSpread1.TypeComboBoxWidth = 1

Copyright © GrapeCity, inc. All rights reserved.