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 item'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 Number = object->Data; long Number = object->GetData(); |
C | HRESULT object->get_Data(long* Number); |
Put
VB.NET | object.Data = Number As Integer |
VB | object.Data = Number As Long |
C#.NET | int object.Data = Number; |
VC++ | long object->Data = Number; void object->PutData(long Number); |
C | HRESULT object->put_Data(long Number); |
object
A SftTreeItem object.
Number
Defines the item's application specific numeric value.
The Data property defines the item's application specific numeric value.
The Data property can be used to store an application specific value with an item. Possible uses include storing values used for sorting purposes (see Items.SortDependents method).
Additional properties used to associate an application defined value with an item are Item.DataFloat, Item.DataObject, Item.DataString and Item.DataTag. These are distinct properties and can be used at the same time.
Cell related data can be saved using the Cell.Data, Cell.DataObject, Cell.DataString and Cell.DataTag properties.
AxSftTree1.get_Cell(bookIndex, 1).Text = "Description for book " + bk.ToString() Dim size As Integer If bk = 1 Then size = R.Next(1, 99) Else size = R.Next(1, 999) End If AxSftTree1.get_Cell(bookIndex, 2).Text = size.ToString() AxSftTree1.get_Item(bookIndex).Data = size ' add chapters Dim ch As Integer For ch = 1 To 2 Dim index As Integer index = AxSftTree1.Items.Add("Chapter " & ch) AxSftTree1.get_Item(index).Level = 1 ' add sections
' Add all available options For Bk = 1 To 4 ' add a book BookIndex = .Items.Add("Book " & Bk) .Cell(BookIndex, 1).Text = "Description for book " & Bk size = Int((1000 * Rnd) + 1) .Cell(BookIndex, 2).Text = size .Item(BookIndex).Data = size ' add chapters For Ch = 1 To 2 ItemIndex = .Items.Add("Chapter " & Ch) .Item(ItemIndex).Level = 1 ' add sections For Sect = 1 To 2 ItemIndex = .Items.Add("Section " & Sect)
for (int bk = 1 ; bk <= 4 ; ++bk) { // add a book int bookIndex = axSftTree1.Items.Add("Book " + bk.ToString()); axSftTree1.get_Cell(bookIndex, 1).Text = "Description for book " + bk.ToString(); int size = random.Next(1, bk == 1 ? 99 : 999); axSftTree1.get_Cell(bookIndex, 2).Text = size.ToString(); axSftTree1.get_Item(bookIndex).Data = size; // add chapters for (int ch = 1 ; ch <= 2 ; ++ch) { int index = axSftTree1.Items.Add("Chapter " + ch.ToString()); axSftTree1.get_Item(index).Level = 1; // add sections for (int sect = 1 ; sect <= 2 ; ++sect) { index = axSftTree1.Items.Add("Section " + sect.ToString()); axSftTree1.get_Item(index).Level = 2;
long BookIndex = m_vTree->Items->Add(_bstr_t(str)); str.Format(_T("Description for book %d"), bk); m_vTree->Cell[BookIndex][1]->Text = (_bstr_t)str; int size = (rand() % 999) + 1; str.Format(_T("%d"), size); m_vTree->Cell[BookIndex][2]->Text = (_bstr_t)str; m_vTree->Item[BookIndex]->Data = size; // add chapters for (int ch = 1 ; ch <= 2 ; ++ch) { str.Format(_T("Chapter %d"), ch); long Index = m_vTree->Items->Add((_bstr_t)str); m_vTree->Item[Index]->Level = 1; // add sections
See Also SftTreeItem Object | Object Hierarchy