

| Type | Description | |||
| Property as DefColumnEnum | A DefColumnEnum expression that indicates the property being changed. | |||
| Variant | A Variant value that specifies the newly value. |
The following VB sample assigns checkboxes for all cells in the first column:
ComboBox1.Columns(0).Def(exCellHasCheckBox) = True
The following VB sample changes the background color for all cells in the first column:
With ComboBox1.Columns(0)
.Def(exCellBackColor) = RGB(240, 240, 240)
End With
The following C++ sample assigns checkboxes for all cells in the first column:
COleVariant vtCheckBox( VARIANT_TRUE ); m_combobox.GetColumns().GetItem( COleVariant( (long) 0 ) ).SetDef( /*exCellHasCheckBox*/ 0, vtCheckBox );
The following C++ sample changes the background color for all cells in the first column:
COleVariant vtBackColor( (long)RGB(240, 240, 240) ); m_combobox.GetColumns().GetItem( COleVariant( (long) 0 ) ).SetDef( /*exCellBackColor*/ 4, vtBackColor );
The following VB.NET sample assigns checkboxes for all cells in the first column:
With AxComboBox1.Columns(0)
.Def(EXCOMBOBOXLib.DefColumnEnum.exCellHasCheckBox) = True
End With
The following VB.NET sample changes the background color for all cells in the first column:
With AxComboBox1.Columns(0)
.Def(EXCOMBOBOXLib.DefColumnEnum.exCellBackColor) = ToUInt32(Color.WhiteSmoke)
End With
where the ToUInt32 function converts a Color expression to an OLE_COLOR,
Shared Function ToUInt32(ByVal c As Color) As UInt32
Dim i As Long
i = c.R
i = i + 256 * c.G
i = i + 256 * 256 * c.B
ToUInt32 = Convert.ToUInt32(i)
End Function
The following C# sample assigns checkboxes for all cells in the first column:
axComboBox1.Columns[0].set_Def( EXCOMBOBOXLib.DefColumnEnum.exCellHasCheckBox, true );
The following C# sample changes the background color for all cells in the first column:
axComboBox1.Columns[0].set_Def(EXCOMBOBOXLib.DefColumnEnum.exCellBackColor, ToUInt32(Color.WhiteSmoke));
where the ToUInt32 function converts a Color expression to an OLE_COLOR,
private UInt32 ToUInt32(Color c)
{
long i;
i = c.R;
i = i + 256 * c.G;
i = i + 256 * 256 * c.B;
return Convert.ToUInt32(i);
}
The following VFP sample assigns checkboxes for all cells in the first column:
with thisform.ComboBox1.Columns(0) .Def( 0 ) = .t. endwith
The following VFP sample changes the background color for all cells in the first column:
with thisform.ComboBox1.Columns(0) .Def( 4 ) = RGB(240, 240, 240) endwith