Hide

SftDirectory 3.5 - ActiveX File/Folder Control

Display
Print

SftDirectory.CheckBoxClicked Event

A checkbox is clicked.

Syntax

VB.NETPrivate Sub object_CheckBoxClicked(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.CheckBoxClicked
VBPrivate Sub object_CheckBoxClicked(Folder As SftDirectoryFolder, ByVal OldValue As SftDirectoryCheckBoxValueConstants, NewValue As SftDirectoryCheckBoxValueConstants)
C#.NETvoid object_CheckBoxClicked(object sender, EventArgumentType e);
VC++void OnCheckBoxClickedobject(ISftDirectoryFolder* Folder, enum SftDirectoryCheckBoxValueConstants OldValue, enum SftDirectoryCheckBoxValueConstants* NewValue);
CHRESULT OnCheckBoxClickedobject(ISftDirectoryFolder* Folder, enum SftDirectoryCheckBoxValueConstants OldValue, enum SftDirectoryCheckBoxValueConstants* NewValue);

object

A SftDirectory object.

Folder

Defines the folder whose checkbox is clicked.

OldValue

The current checkbox value (before being clicked).

OldValueValueDescription
checkboxSftDirectoryNone0None - While this is a valid SftDirectoryCheckBoxValueConstants value, it is never passed to the CheckBoxClicked event.
checkboxSftDirectoryNo1Not selected - The checkbox option is enabled and not selected. NewValue defaults to checkboxSftDirectoryYes.
checkboxSftDirectoryYes2Selected - The checkbox option is enabled and selected. NewValue defaults to checkboxSftDirectoryNo.
checkboxSftDirectoryUnknown3Unknown - The checkbox option is enabled and unknown.
checkboxSftDirectoryNoDisabled4Not selected, disabled - The checkbox option is disabled and not selected.
checkboxSftDirectoryYesDisabled5Selected, disabled - The checkbox option is disabled and selected.
checkboxSftDirectoryUnknownDisabled6Unknown, disabled - The checkbox option is disabled and unknown.

NewValue

The new checkbox value to take effect once the CheckBoxClicked event is processed.

NewValueValueDescription
checkboxSftDirectoryNone0None - The checkbox is removed.
checkboxSftDirectoryNo1Not selected - The checkbox option is enabled and not selected.
checkboxSftDirectoryYes2Selected - The checkbox option is enabled and selected.
checkboxSftDirectoryUnknown3Unknown - The checkbox option is enabled and unknown.
checkboxSftDirectoryNoDisabled4Not selected, disabled - The checkbox option is disabled and not selected.
checkboxSftDirectoryYesDisabled5Selected, disabled - The checkbox option is disabled and selected.
checkboxSftDirectoryUnknownDisabled6Unknown, disabled - The checkbox option is disabled and unknown.

Comments

The CheckBoxClicked event occurs when a checkbox is clicked.

An application can override the new checkbox state NewValue using the CheckBoxClicked event.

The checkbox state of a folder does not automatically affect its child folders' or parent folder's checkbox states. If desired, these must be updated explicitly using the SetSubFolderCheckBoxes method or the EvaluateSubFolderCheckBoxes method.

This event is typically implemented to handle checkbox states other than yes/no (checkboxSftDirectoryYes and checkboxSftDirectoryNo). By default, checkbox state checkboxSftDirectoryNo is toggled to checkboxSftDirectoryYes and vice versa. Other checkbox states such as checkboxSftDirectoryUnknown, checkboxSftDirectoryNoDisabled, checkboxSftDirectoryYesDisabled or checkboxSftDirectoryUnknownDisabled are not altered, but can be modified using the CheckBoxClicked event, by supplying a new state NewValue.

Examples

VB.NET

            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)

VB6

        Style = headersSftDirectoryNone
    End If
    SftDirectoryTV.Headers.Style = Style
    SftDirectoryDL.Headers.Style = Style
    SftDirectoryTV_Combo.Headers.Style = Style
    SftDirectoryDL_Combo.Headers.Style = Style
End Sub

Private Sub SftDirectoryTV_CheckBoxClicked(ByVal Folder As SftDirectoryLib30.ISftDirectoryFolder, ByVal OldValue As SftDirectoryLib30.SftDirectoryCheckBoxValueConstants, NewValue As SftDirectoryLib30.SftDirectoryCheckBoxValueConstants)
    If NewValue <> checkboxSftDirectoryNo And NewValue <> checkboxSftDirectoryYes Then
        NewValue = checkboxSftDirectoryYes
    End If
    SftDirectoryTV.CurrentFolder.SetSubFolderCheckBoxes NewValue, True
    SftDirectoryTV.CurrentFolder.CheckBox = NewValue
    SftDirectoryTV.RootFolder.EvaluateSubFolderCheckBoxes True
End Sub

C#

    else
        style = SftDirectoryHeadersStyleConstants.headersSftDirectoryNone;
    axSftDirectoryTV.Headers.Style = style;
    axSftDirectoryDL.Headers.Style = style;
    axSftDirectoryTV_Combo.Headers.Style = style;
    axSftDirectoryDL_Combo.Headers.Style = style;
}

private void axSftDirectoryTV_CheckBoxClicked(object sender, AxSftDirectoryLib30._ISftDirectoryEvents_CheckBoxClickedEvent e) {
    if (e.newValue != SftDirectoryCheckBoxValueConstants.checkboxSftDirectoryNo &&
            e.newValue != SftDirectoryCheckBoxValueConstants.checkboxSftDirectoryYes) {
        e.newValue = SftDirectoryCheckBoxValueConstants.checkboxSftDirectoryYes;
    }
    axSftDirectoryTV.CurrentFolder.SetSubFolderCheckBoxes(e.newValue, true);
    axSftDirectoryTV.CurrentFolder.CheckBox = e.newValue;
    axSftDirectoryTV.RootFolder.EvaluateSubFolderCheckBoxes(true);

C++

    ISftDirectoryPtr vDirDL = m_SftDirectoryDL.GetControlUnknown();
    vDirDL->Headers->Style = style;
    ISftDirectoryPtr vDirTV_Combo = m_SftDirectoryTV_Combo.GetControlUnknown();
    vDirTV_Combo->Headers->Style = style;
    ISftDirectoryPtr vDirDL_Combo = m_SftDirectoryDL_Combo.GetControlUnknown();
    vDirDL_Combo->Headers->Style = style;
}

void CControlStylesDlg::OnCheckBoxClickedSftDirectoryTV(LPDISPATCH Folder, long OldValue, long FAR* NewValue)
{
    if (*NewValue != checkboxSftDirectoryNo && *NewValue != checkboxSftDirectoryYes)
        *NewValue = checkboxSftDirectoryYes;
    ISftDirectoryPtr vDirTV = m_SftDirectoryTV.GetControlUnknown();
    vDirTV->CurrentFolder->SetSubFolderCheckBoxes((SftDirectoryCheckBoxValueConstants) *NewValue, VARIANT_TRUE);
    vDirTV->CurrentFolder->CheckBox = (SftDirectoryCheckBoxValueConstants) *NewValue;
    vDirTV->RootFolder->EvaluateSubFolderCheckBoxes(VARIANT_TRUE);

See Also SftDirectory Object | Object Hierarchy


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