SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Defines the cell's application specific numeric value.
Get
VB.NET | Number = object.Data As Integer |
VB | Number = object.Data As Long |
C#.NET | int Number = object.Data; |
VC++ | LONG_PTR Number = object->Data; LONG_PTR Number = object->GetData(); |
C | HRESULT object->get_Data(LONG_PTR* Number); |
Put
VB.NET | object.Data = Number As Integer |
VB | object.Data = Number As Long |
C#.NET | int object.Data = Number; |
VC++ | LONG_PTR object->Data = Number; void object->PutData(LONG_PTR Number); |
C | HRESULT object->put_Data(LONG_PTR Number); |
object
Number
Defines the cell's application specific numeric value. This data is application defined, but is also used by the Items.AddFontNames, AddFontStyles, AddFontSizes methods.
The Data property defines the cell's application specific numeric value.
The Items.AddFontNames, Items.AddFontStyles, Items.AddFontSizes methods store additional information in the Data property for each item added.
The Data property can be used for sorting purposes using the Items.Sort method or can be located using the Items.FindCellData method.
The Cell.DataString, Cell.DataObject, Cell.DataTag properties can be used to store additional application specific data, using other data types (strings, objects, variants).
Additional properties used to associate an application defined value with an item are Item.Data, Item.DataTag and Item.DataObject. These are distinct properties and can be used at the same time.
End Sub Private Sub UpdateSample() Dim SelItem As Integer = fontStyles.Items.Selection If SelItem >= 0 And fontSizes.Edit.Text <> "" Then sampleText.Text = "AaBbCcYyZz" Dim style As FontStyle = 0 If (fontStyles.get_Cell(SelItem, 0).Data And &H80000000&) <> 0 Then style = style Or FontStyle.Italic Dim weight As Integer = fontStyles.get_Cell(SelItem, 0).Data And &H7FFFFFFF& If weight > 400 Then style = style Or FontStyle.Bold sampleText.Font = New Font(fontNames.Edit.Text, Convert.ToSingle(fontSizes.Edit.Text), style) Else sampleText.Text = "" End If End Sub
If SftBoxCtrl.Header(0).Image.Appearance = sftImageSortAsc Then SftBoxCtrl.Header(0).Image.Appearance = sftImageSortDesc Else SftBoxCtrl.Header(0).Image.Appearance = sftImageSortAsc End If End Sub Private Sub PerformCellValueSort(SftBoxCtrl As SftBox) ' Font sizes are sorted according to numeric Cell.Data property If SftBoxCtrl.Header(0).Image.Appearance = sftImageSortAsc Then SftBoxCtrl.Items.Sort -1, 0, sortSftBoxCellValueAscending Else SftBoxCtrl.Items.Sort -1, 0, sortSftBoxCellValueDescending End If End Sub
} private void UpdateSample() { int SelItem = fontStyles.Items.Selection; if (SelItem >= 0 && fontSizes.Edit.Text != "") { sampleText.Text = "AaBbCcYyZz"; FontStyle style = 0; if ((fontStyles.get_Cell(SelItem, 0).Data & 0x80000000) != 0) style |= FontStyle.Italic; int weight = (fontStyles.get_Cell(SelItem, 0).Data & 0x7fffffff); if (weight > 400) style |= FontStyle.Bold; sampleText.Font = new Font(fontNames.Edit.Text, Convert.ToSingle(fontSizes.Edit.Text), style); } else sampleText.Text = "";
{ ISftBoxPtr vFontNames = m_FontNames.GetControlUnknown(); ISftBoxPtr vFontStyles = m_FontStyles.GetControlUnknown(); ISftBoxPtr vFontSizes = m_FontSizes.GetControlUnknown(); long SelItem = vFontStyles->Items->Selection; if (SelItem >= 0 && lstrcmp(vFontSizes->Edit->Text, "") != 0) { m_Sample.SetWindowText(_T("AaBbCcYyZz")); long val = (long) vFontStyles->Cell[SelItem][0]->Data; BOOL fItalic = (val & 0x80000000L) != 0; val &= 0x7fffffff; m_SampleFont.DeleteObject(); // convert point size to pixels CDC* pDC; pDC = GetDC();
See Also SftBoxCell Object | Object Hierarchy