Hide

SftDirectory 3.5 - ActiveX File/Folder Control

Display
Print

ControlStyles Sample (VB.NET)

This sample demonstrates the control styles (ControlStyle property).

The source code is located at C:\Program Files (x86)\Softelvdm\SftDirectory 3.5\Samples\Visual Studio - VB.NET\ControlStyles\Form1.vb or C:\Program Files\Softelvdm\SftDirectory 3.5\Samples\Visual Studio - VB.NET\ControlStyles\Form1.vb (on 32-bit Windows versions).

Private Sub CheckTreeLines_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckTreeLines.CheckedChanged
    Dim style As SftDirectoryTreeLineStyleConstants

    If CheckTreeLines.CheckState = CheckState.Checked Then
        style = SftDirectoryTreeLineStyleConstants.treeLineStyleSftDirectoryDotted
    Else
        style = SftDirectoryTreeLineStyleConstants.treeLineStyleSftDirectoryNone
    End If
    AxSftDirectoryTV.TreeLineStyle = style
    AxSftDirectoryDL.TreeLineStyle = style
    AxSftDirectoryTV_Combo.TreeLineStyle = style
    AxSftDirectoryDL_Combo.TreeLineStyle = style
End Sub

Private Sub CheckCheckBoxes_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckCheckBoxes.CheckedChanged
    Dim style As SftDirectoryCheckBoxDisplayConstants

    If CheckCheckBoxes.CheckState = CheckState.Checked Then
        style = SftDirectoryCheckBoxDisplayConstants.checkboxDisplaySftDirectoryAll
    Else
        style = SftDirectoryCheckBoxDisplayConstants.checkboxDisplaySftDirectoryNone
    End If
    AxSftDirectoryTV.ShowCheckBoxes = style
    AxSftDirectoryDL.ShowCheckBoxes = style
    AxSftDirectoryTV_Combo.ShowCheckBoxes = style
    AxSftDirectoryDL_Combo.ShowCheckBoxes = style
End Sub

Private Sub CheckShowHeaders_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckShowHeaders.CheckedChanged
    Dim style As SftDirectoryHeadersStyleConstants

    If CheckShowHeaders.CheckState = CheckState.Checked Then
        style = SftDirectoryHeadersStyleConstants.headersSftDirectoryButton
    Else
        style = SftDirectoryHeadersStyleConstants.headersSftDirectoryNone
    End If
    AxSftDirectoryTV.Headers.Style = style
    AxSftDirectoryDL.Headers.Style = style
    AxSftDirectoryTV_Combo.Headers.Style = style
    AxSftDirectoryDL_Combo.Headers.Style = style
End Sub

Private Sub AxSftDirectoryTV_CheckBoxClicked(ByVal sender As Object, ByVal e As AxSftDirectoryLib30._ISftDirectoryEvents_CheckBoxClickedEvent) Handles AxSftDirectoryTV.CheckBoxClicked
    If e.newValue <> SftDirectoryCheckBoxValueConstants.checkboxSftDirectoryNo And _
            e.newValue <> SftDirectoryCheckBoxValueConstants.checkboxSftDirectoryYes Then
        e.newValue = SftDirectoryCheckBoxValueConstants.checkboxSftDirectoryYes
    End If
    AxSftDirectoryTV.CurrentFolder.SetSubFolderCheckBoxes(e.newValue, True)
    AxSftDirectoryTV.CurrentFolder.CheckBox = e.newValue
    AxSftDirectoryTV.RootFolder.EvaluateSubFolderCheckBoxes(True)
End Sub

Private Sub AxSftDirectoryTV_Combo_CheckBoxClicked(ByVal sender As Object, ByVal e As AxSftDirectoryLib30._ISftDirectoryEvents_CheckBoxClickedEvent) Handles AxSftDirectoryTV_Combo.CheckBoxClicked
    If e.newValue <> SftDirectoryCheckBoxValueConstants.checkboxSftDirectoryNo And _
            e.newValue <> SftDirectoryCheckBoxValueConstants.checkboxSftDirectoryYes Then
        e.newValue = SftDirectoryCheckBoxValueConstants.checkboxSftDirectoryYes
    End If
    AxSftDirectoryTV_Combo.CurrentFolder.SetSubFolderCheckBoxes(e.newValue, True)
    AxSftDirectoryTV_Combo.CurrentFolder.CheckBox = e.newValue
    AxSftDirectoryTV_Combo.RootFolder.EvaluateSubFolderCheckBoxes(True)
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    CheckTreeLines.CheckState = CheckState.Checked
End Sub

Private Sub CloseButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseButton.Click
    Application.Exit()
End Sub
End Class

Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.