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:
List1.Columns(0).Def(exCellHasCheckBox) = True
The following VB sample changes the background color for all cells in the first column:
List1.Columns(0).Def(exCellBackColor) = RGB(240, 240, 240)
The following C++ sample assigns checkboxes for all cells in the first column:
COleVariant vtCheckBox( VARIANT_TRUE ); m_list.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_list.GetColumns().GetItem( COleVariant( (long) 0 ) ).SetDef( /*exCellBackColor*/ 4, vtBackColor );
The following VB.NET sample assigns checkboxes for all cells in the first column:
With AxList1.Columns(0) .Def(EXLISTLib.DefColumnEnum.exCellHasCheckBox) = True End With
The following VB.NET sample changes the background color for all cells in the first column:
With AxList1.Columns(0) .Def(EXLISTLib.DefColumnEnum.exCellBackColor) = ToUInt32(Color.WhiteSmoke) End With
where the ToUInt32 function converts a Color expression to 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:
axList1.Columns[0].set_Def( EXLISTLib.DefColumnEnum.exCellHasCheckBox, true );
The following C# sample changes the background color for all cells in the first column:
axList1.Columns[0].set_Def(EXLISTLib.DefColumnEnum.exCellBackColor, ToUInt32(Color.WhiteSmoke));
where the ToUInt32 function converts a Color expression to 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.List1.Columns(0) .Def( 0 ) = .t. endwith
The following VFP sample changes the background color for all cells in the first column:
with thisform.List1.Columns(0) .Def( 4 ) = RGB(240,240,240) endwith