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
This sample demonstrates how to add items and child items, with checkboxes and radiobuttons.
Imports System.Reflection
Imports Softelvdm.Controls
Imports Softelvdm.SftTreeNET
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
sftTree1.Initializing = True
sftTree1.Columns.Count = 1
' This sample demonstrates how radiobuttons are used in cells.
' To prepare for this sample, create a new project with a blank form and add
' a SftTree/NET control named sftTree1.
' In addition, adjust the following FromFile method to use a (small) bitmap
' that is located on your system.
Dim img As Image = Bitmap.FromFile("..\\..\\test.gif")
' Add an item
Dim item As ItemClass = sftTree1.ItemCollection.Add()
Dim cell As CellClass = item.Cells(0)
item.Image = img
cell.Text = "Category 1"
' Add some sub items
Dim subItem As ItemClass = item.Add()
Dim rb As RadioButtonPartClass = New RadioButtonPartClass(RadioButtonStateEnum.Checked)
subItem.Cells(0).Parts.Add(rb)
subItem.Cells(0).Parts.Add(New CheckBoxPartClass())
subItem.Cells(0).Parts.Add(New TextPartClass("Item 1"))
subItem = item.Add()
rb = New RadioButtonPartClass(RadioButtonStateEnum.Unchecked)
subItem.Cells(0).Parts.Add(rb)
subItem.Cells(0).Parts.Add(New TextPartClass("Item 2"))
subItem = item.Add()
rb = New RadioButtonPartClass(RadioButtonStateEnum.Unchecked)
subItem.Cells(0).Parts.Add(rb)
subItem.Cells(0).Parts.Add(New TextPartClass("Item 3"))
sftTree1.Columns.MakeOptimal(0, False)
sftTree1.RecalcHorizontalExtent()
sftTree1.Initializing = False
End Sub
' ItemClick event
Private Sub sftTree1_ItemClick(ByVal sender As Object, ByVal e As Softelvdm.SftTreeNET.ItemClickEventArgs) Handles sftTree1.ItemClick
Debug.Write("** ItemClick")
DumpValues(e)
End Sub
' This is a small helper routine to show all properties and fields of an object
Private Sub DumpValues(ByVal o As Object)
Dim api() As PropertyInfo = o.GetType().GetProperties()
For Each pi As PropertyInfo In api
Debug.Write(" " & pi.Name & " " & pi.GetValue(o, New Object() ))
Next
Dim afi() As FieldInfo = o.GetType().GetFields()
For Each fi As FieldInfo In afi
Dim t As Object = fi.GetValue(o)
Dim s As String = "(null)"
If Not t Is Nothing Then s = t.ToString()
Debug.Write(" " & fi.Name & " " & s)
Next
Debug.WriteLine("")
End Sub
End Class