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 ID of the item.
Get
VB.NET | ItemID = object.ID As Integer |
VB | ItemID = object.ID As Long |
C#.NET | int ItemID = object.ID; |
VC++ | long ItemID = object->ID; long ItemID = object->GetID(); |
C | HRESULT object->get_ID(long* ItemID); |
Put
VB.NET | object.ID = ItemID As Integer |
VB | object.ID = ItemID As Long |
C#.NET | int object.ID = ItemID; |
VC++ | long object->ID = ItemID; void object->PutID(long ItemID); |
C | HRESULT object->put_ID(long ItemID); |
object
A SftTreeItem object.
ItemID
Defines the item ID of the item.
The ID property defines the item ID of the item.
The tree control automatically assigns a unique item ID to items as they are added to the control. The item ID defined by the ID property does not change throughout the lifetime of an item. Even if an item changes its index position because other items are deleted or inserted, the item ID remains constant.
An application can change an item's item ID using the ID property. In this case, if a unique item ID is required, the application must insure using its own mechanisms that unique IDs are used.
The item index describes the zero-based position of an item in a tree control.
An item ID can be translated into an item index using the Items.ItemIndex property.
AxSftTree1.get_Cell(ItemIndex, 0).Font = m_BoldFont ' if this folder has no messages (ie. dependents), we still want the ' folder graphic, not the email (leaf) graphic If Count = 0 Then AxSftTree1.get_Item(ItemIndex).Image = AxSftTree1.Items.ItemImageExpandable End If AddFolder = AxSftTree1.get_Item(ItemIndex).ID End Function Private Function AddMessage(ByVal Level As Integer, ByVal Email As String, ByVal Desc As String, ByVal Dt As String, ByVal Size As Integer, ByVal Attachment As Boolean) As Integer Dim ItemIndex As Integer ItemIndex = AxSftTree1.Items.Add(Email) ' add folder AxSftTree1.get_Item(ItemIndex).Level = Level AxSftTree1.get_Cell(ItemIndex, 1).Text = Desc ' add description
' make the folder name bold .Cell(ItemIndex, 0).Font.Bold = True ' if this folder has no messages (ie. dependents), we still want the ' folder graphic, not the email (leaf) graphic If Count = 0 Then .Item(ItemIndex).Image = .Items.ItemImageExpandable End If AddFolder = .Item(ItemIndex).ID End With End Function Private Function AddMessage(ByVal Level As Integer, ByVal Email As String, ByVal Desc As String, ByVal Dt As String, ByVal Size As Integer, ByVal Attachment As Boolean) Dim ItemIndex As Long With SftTree1 ItemIndex = .Items.Add(Email) ' add folder
} axSftTree1.get_Cell(ItemIndex, 0).Font = m_BoldFont; // if this folder has no messages (ie. dependents), we still want the // folder graphic, not the email (leaf) graphic if (Count == 0) axSftTree1.get_Item(ItemIndex).Image = axSftTree1.Items.ItemImageExpandable; return axSftTree1.get_Item(ItemIndex).ID; } private int AddMessage(short Level, string Email, string Desc, string Dt, int Size, bool Attachment) { int ItemIndex = axSftTree1.Items.Add(Email); // add folder axSftTree1.get_Item(ItemIndex).Level = Level; axSftTree1.get_Cell(ItemIndex, 1).Text = Desc; // add description
// make the folder name bold IFontDispPtr pFont = m_pBoldCellFont; m_vTree->Cell[ItemIndex][0]->PutRefFont(pFont); // if this folder has no messages (ie. dependents), we still want the // folder graphic, not the email (leaf) graphic if (Count == 0) m_vTree->Item[ItemIndex]->Image = m_vTree->Items->ItemImageExpandable; return m_vTree->Item[ItemIndex]->ID; } long CEmailDlg::AddMessage(int Level, LPCTSTR lpszEmail, LPCTSTR lpszDesc, LPCTSTR lpszDt, int Size, BOOL Attachment) { long ItemIndex; ItemIndex = m_vTree->Items->Add(lpszEmail); // add folder m_vTree->Item[ItemIndex]->Level = Level;
See Also SftTreeItem Object | Object Hierarchy