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 selection changes.
VB.NET | Private Sub object_SelectionChange(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.SelectionChange |
VB | Private Sub object_SelectionChange() |
C#.NET | void object_SelectionChange(object sender, EventArgumentType e); |
VC++ | void OnSelectionChangeobject(); |
C | HRESULT OnSelectionChangeobject(); |
object
The SelectionChange event occurs when the selection changes.
The SelectionChange event is not limited to mouse events as the selection can change through keyboard input also. To determine which mouse button was pressed and/or in which area of the tree control the mouse button was pressed, use the MouseDown or ItemClick events.
The Items.SelectionArea property can be used to control the areas that cause a selection change.
AxSftTree1.Items.RecalcHorizontalExtent() ' Update horizontal scroll bar ElseIf AreaType = SftTreeAreaTypeConstants.constSftTreeColumn And e.colIndex = 0 Then SetSortDirection(Not m_SortDirection) ElseIf AreaType = SftTreeAreaTypeConstants.constSftTreeCellGraphic Then ToggleImage(AxSftTree1.get_Cell(e.itemIndex, e.colIndex).Image) End If End Sub Private Sub AxSftTree1_SelectionChange(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftTree1.SelectionChange CopyImageFromCurrentItem() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ' update all cells that have a progress bar by incrementing the progress value Dim Items As Integer = AxSftTree1.Items.Count Dim Cols As Integer = AxSftTree1.ColumnsObj.Count
SftTree1.Items.RecalcHorizontalExtent ' Update horizontal scroll bar ElseIf Area = constSftTreeColumn And ColIndex = 0 Then SetSortDirection Not SortDirection ElseIf Area = constSftTreeCellGraphic Then ToggleImage SftTree1.Cell(ItemIndex, ColIndex).Image End If End Sub Private Sub SftTree1_SelectionChange() CopyImageFromCurrentItem End Sub Private Sub Timer1_Timer() ' update all cells that have a progress bar by incrementing the progress value Dim Total As Integer, Cols As Integer, ItemIndex As Integer Total = SftTree1.Items.Count
axSftTree1.get_Column(e.colIndex).MakeOptimal(); // Make column width optimal axSftTree1.Items.RecalcHorizontalExtent(); // Update horizontal scroll bar } else if (areaType == SftTreeAreaTypeConstants.constSftTreeColumn && e.colIndex == 0) SetSortDirection(!m_SortDirection); else if (areaType == SftTreeAreaTypeConstants.constSftTreeCellGraphic) ToggleImage(axSftTree1.get_Cell(e.itemIndex, e.colIndex).Image); } private void axSftTree1_SelectionChange(object sender, System.EventArgs e) { CopyImageFromCurrentItem(); } private void timer1_Tick(object sender, EventArgs e) { // update all cells that have a progress bar by incrementing the progress value int items = axSftTree1.Items.Count; int cols = axSftTree1.ColumnsObj.Count;
m_vTree->Column[ColIndex]->MakeOptimal(); // Make column width optimal m_vTree->Items->RecalcHorizontalExtent(); // Update horizontal scroll bar } else if (AreaType == constSftTreeColumn && ColIndex == 0) SetSortDirection(!m_fSortDirection); else if (AreaType == constSftTreeCellGraphic) ToggleImage(m_vTree->Cell[ItemIndex][ColIndex]->Image); } void CPicturesDlg::OnSelectionChangeSftTree1() { CopyImageFromCurrentItem(); } void CPicturesDlg::ShowSortDirection(BOOL fAscending) { if (fAscending)
See Also SftTree Object | Object Hierarchy