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
The virtual data source is called to provide item information.
VB.NET | Private Sub object_VirtualItem(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.VirtualItem |
VB | Private Sub object_VirtualItem(ByVal RowIndex As Long, ItemObject As VirtualItem) |
C#.NET | void object_VirtualItem(object sender, EventArgumentType e); |
VC++ | void OnVirtualItemobject(long RowIndex, IVirtItem* ItemObject); |
C | HRESULT OnVirtualItemobject(long RowIndex, IVirtItem* ItemObject); |
object
RowIndex
The zero-based index number of the item for which item information is requested.
ItemObject
A VirtualItem object which should be updated by the application to reflect the item attributes.
The VirtualItem event occurs when the virtual data source is called to provide item information.
The VirtualItem event occurs when the tree control is in virtual mode (see VirtualMode). The event must be implemented by the application to provide information and item attributes to SftTree/OCX.
SftTree/OCX caches the items that are currently displayed in the tree control's client area. If an item is changed by the application's virtual data source (i.e. its external data source), the VirtualItemChanged method should be called to notify SftTree/OCX.
To enable graphics components, the VirtualPictures method must be used. The VirtualCount method is used to define the number of items represented by the tree control.
The VirtualItem object is used by the application to set all properties for the requested item RowIndex. The application provides all data for the requested item RowIndex using the VirtualItem.Item property.
While handling the VirtualItem event, the application cannot modify or retrieve any tree control attributes.
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick AxSftTree1.RowColumnHeader.Image.NETImageObject = imageListWorld.Images(m_PicCount) m_PicCount = m_PicCount + 1 If m_PicCount >= imageListWorld.Images.Count Then m_PicCount = 0 End If End Sub Private Sub AxSftTree1_VirtualItem(ByVal sender As Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_VirtualItemEvent) Handles AxSftTree1.VirtualItem e.itemObject.Item.Cell(0).Text = "Item " & e.rowIndex e.itemObject.Item.Cell(1).Text = "Cell " & e.rowIndex e.itemObject.Item.Cell(2).Text = "A" e.itemObject.Item.Cell(3).Text = (e.rowIndex Mod 7) e.itemObject.Item.Cell(4).Text = "Last " & e.rowIndex e.itemObject.Item.RowHeader.Text = "R" & e.rowIndex e.itemObject.Item.Enabled = ((e.rowIndex Mod 2) = 0)
End Sub Private Sub SftTree1_ItemDblClick(ByVal ItemIndex As Long, ByVal ColIndex As Integer, ByVal AreaType As Integer, ByVal Button As Integer, ByVal Shift As Integer) If AreaType = constSftTreeColumnRes Then SftTree1.Column(ColIndex).MakeOptimal End If End Sub Private Sub SftTree1_VirtualItem(ByVal RowIndex As Long, ByVal ItemObject As VirtualItem) ItemObject.Item.Cell(0).Text = "Item " & RowIndex ItemObject.Item.Cell(1).Text = "Cell " & RowIndex ItemObject.Item.Cell(2).Text = "A" ItemObject.Item.Cell(3).Text = RowIndex Mod 7 ItemObject.Item.Cell(4).Text = "Last " & RowIndex ItemObject.Item.RowHeader.Text = "R" & RowIndex ItemObject.Item.Enabled = ((RowIndex Mod 2) = 0)
private void Timer1_Tick(object sender, System.EventArgs e) { axSftTree1.RowColumnHeader.Image.NETImageObject = imageListWorld.Images[m_PicCount]; ++m_PicCount; if (m_PicCount >= imageListWorld.Images.Count) m_PicCount = 0; } private void axSftTree1_VirtualItem(object sender, AxSftTreeLib75._DSftTreeEvents_VirtualItemEvent e) { e.itemObject.Item.get_Cell(0).Text = "Item " + e.rowIndex; e.itemObject.Item.get_Cell(1).Text = "Cell " + e.rowIndex.ToString(); e.itemObject.Item.get_Cell(2).Text = "A"; e.itemObject.Item.get_Cell(3).Text = (e.rowIndex % 7).ToString(); e.itemObject.Item.get_Cell(4).Text = "Last " + e.rowIndex.ToString(); e.itemObject.Item.RowHeader.Text = "R" + e.rowIndex.ToString(); e.itemObject.Item.Enabled = ((e.rowIndex % 2) == 0);
} void CVirtualDlg::OnItemDblClickSftTree1(long ItemIndex, short ColIndex, short AreaType, short Button, short Shift) { if (AreaType == constSftTreeColumnRes) m_vTree->Column[ColIndex]->MakeOptimal(); } void CVirtualDlg::OnVirtualItemSftTree1(long RowIndex, LPDISPATCH ItemObject) { IVirtualItemPtr pItemObj = ItemObject; CString str; str.Format(_T("Item %ld"), RowIndex); pItemObj->Item->Cell[0]->Text = (LPCTSTR) str; str.Format(_T("Cell %ld"), RowIndex);
See Also SftTree Object | Object Hierarchy