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
Returns the item index given an item ID.
Get
| VB.NET | ItemIndex = object.ItemIndex(ByVal ID As Integer) As Integer |
| VB | ItemIndex = object.ItemIndex(ByVal ID As Long) As Long |
| C#.NET | int ItemIndex = object.get_ItemIndex(int ID); |
| VC++ | long ItemIndex = object->ItemIndex[long ID]; long ItemIndex = object->GetItemIndex(long ID); |
| C | HRESULT object->get_ItemIndex(long ID, long* ItemIndex); |
object
A SftTreeItems object.
ID
The item ID of the item whose index is to be returned.
ItemIndex
Returns the item index given an item ID. -1 is returned if no item has a matching ID.
The ItemIndex property returns the item index given an item ID.
The item ID returned by the Item.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. The item index describes the zero-based position of an item in a tree control.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ItemIndex As Integer
m_InboxFolder = AddFolder("Inbox", "Viewed and unviewed mail", 10)
AddMessage(1, "support@softelvdm.com", "Re: A support question", "10/09/05", 88, True)
AddMessage(1, "anyone@acompany.com", "Re: Why did you say that", "10/10/05", 5, False)
AddMessage(1, "anyone@acompany.com", "Re: You're fired", "10/11/05", 82, True)
AddMessage(1, "anyone@acompany.com", "Re: You're hired", "10/11/05", 6, False)
ItemIndex = AxSftTree1.Items.ItemIndex(m_InboxFolder)
AxSftTree1.get_Item(ItemIndex).Collapse(False)
m_OutboxFolder = AddFolder("Outbox", "Mail about to be sent", 2)
AddMessage(1, "me@mycompany.com", "Re: You're fired", "10/11/05", 5, False)
AddMessage(1, "anyone@acompany.com", "Re: Why did you say that", "10/10/05", 5, False)
ItemIndex = AxSftTree1.Items.ItemIndex(m_OutboxFolder)
AxSftTree1.get_Item(ItemIndex).Collapse(False)
m_SavedFolder = AddFolder("Saved", "Saved messages", 2)
AddMessage(1, "me@mycompany.com", "A support question", "10/09/05", 3, False)
Private Sub Form_Load()
With SftTree1
InboxFolder = AddFolder("Inbox", "Viewed and unviewed mail", 10)
AddMessage 1, "support@softelvdm.com", "Re: A support question", "10/09/05", 88, True
AddMessage 1, "anyone@acompany.com", "Re: Why did you say that", "10/10/05", 5, False
AddMessage 1, "anyone@acompany.com", "Re: You're fired", "10/11/05", 82, True
AddMessage 1, "anyone@acompany.com", "Re: You're hired", "10/11/05", 6, False
.Item(.Items.ItemIndex(InboxFolder)).Collapse False
OutboxFolder = AddFolder("Outbox", "Mail about to be sent", 2)
AddMessage 1, "me@mycompany.com", "Re: You're fired", "10/11/05", 5, False
AddMessage 1, "anyone@acompany.com", "Re: Why did you say that", "10/10/05", 5, False
.Item(.Items.ItemIndex(OutboxFolder)).Collapse False
SavedFolder = AddFolder("Saved", "Saved messages", 2)
AddMessage 1, "me@mycompany.com", "A support question", "10/09/05", 3, False
AddMessage 2, "support@softelvdm.com", "Re: A support question", "10/09/05", 88, True
AddMessage 3, "me@mycompany.com", "Re: A support question", "10/09/05", 3, False
private void Form1_Load(object sender, System.EventArgs e) {
int ItemIndex;
m_InboxFolder = AddFolder("Inbox", "Viewed and unviewed mail", 10);
AddMessage(1, "support@softelvdm.com", "Re: A support question", "10/09/05", 88, true);
AddMessage(1, "anyone@acompany.com", "Re: Why did you say that", "10/10/05", 5, false);
AddMessage(1, "anyone@acompany.com", "Re: You're fired", "10/11/05", 82, true);
AddMessage(1, "anyone@acompany.com", "Re: You're hired", "10/11/05", 6, false);
ItemIndex = axSftTree1.Items.get_ItemIndex(m_InboxFolder);
axSftTree1.get_Item(ItemIndex).Collapse(false);
m_OutboxFolder = AddFolder("Outbox", "Mail about to be sent", 2);
AddMessage(1, "me@mycompany.com", "Re: You're fired", "10/11/05", 5, false);
AddMessage(1, "anyone@acompany.com", "Re: Why did you say that", "10/10/05", 5, false);
ItemIndex = axSftTree1.Items.get_ItemIndex(m_OutboxFolder);
axSftTree1.get_Item(ItemIndex).Collapse(false);
m_SavedFolder = AddFolder("Saved", "Saved messages", 2);
AddMessage(1, "me@mycompany.com", "A support question", "10/09/05", 3, false);
m_pBoldCellFont->put_Bold(TRUE);
m_InboxFolder = AddFolder(_T("Inbox"), _T("Viewed and unviewed mail"), 10);
AddMessage(1, _T("support@softelvdm.com"), _T("Re: A support question"), _T("10/09/05"), 88, TRUE);
AddMessage(1, _T("anyone@acompany.com"), _T("Re: Why did you say that"), _T("10/10/05"), 5, FALSE);
AddMessage(1, _T("anyone@acompany.com"), _T("Re: You're fired"), _T("10/11/05"), 82, TRUE);
AddMessage(1, _T("anyone@acompany.com"), _T("Re: You're hired"), _T("10/11/05"), 6, FALSE);
m_vTree->Item[m_vTree->Items->ItemIndex[m_InboxFolder]]->Collapse(VARIANT_FALSE);
m_OutboxFolder = AddFolder(_T("Outbox"), _T("Mail about to be sent"), 2);
AddMessage(1, _T("me@mycompany.com"), _T("Re: You're fired"), _T("10/11/05"), 5, FALSE);
AddMessage(1, _T("anyone@acompany.com"), _T("Re: Why did you say that"), _T("10/10/05"), 5, FALSE);
m_vTree->Item[m_vTree->Items->ItemIndex[m_OutboxFolder]]->Collapse(VARIANT_FALSE);
m_SavedFolder = AddFolder(_T("Saved"), _T("Saved messages"), 2);
AddMessage(1, _T("me@mycompany.com"), _T("A support question"), _T("10/09/05"), 3, FALSE);
AddMessage(2, _T("support@softelvdm.com"), _T("Re: A support question"), _T("10/09/05"), 88, TRUE);See Also SftTreeItems Object | Object Hierarchy
