Folderbrowser Callback Event in Windows Forms Folder Browser

The FolderBrowserCallback event occurs when an event within the folder browser dialog triggers a call to the validation callback. The event handler receives an argument of type FolderBrowserCallbackEventArgs.

The following FolderBrowserCallbackEventArgs members provide information specific to this event.

Members Description
Dismiss Specifies whether the dialog is either dismissed or retained depending upon this value.
FolderBrowserCallbackSetState Gets/sets the Folder Browser dialog's state.
BrowseCallbackText Gets/sets the contextual string based upon the FolderBrowserCallbackSetState property.
FolderBrowserMessage Returns a value indention the event.
Path Returns valid or invalid folder name.
Window Returns window handle of browser dialog box.

It can be handled when browser validation is required.

This handler is functionally equivalent to the Win32 BrowseCallbackProc callback function.

private void folderBrowser1_BrowseCallback(object sender, Syncfusion.Windows.Forms.FolderBrowserCallbackEventArgs e)

{

// We can log the events and Folder Browser Message to the Label control.

this.label1.Text = String.Format("Event: {0}, Path: {1}", e.FolderBrowserMessage, e.Path);

if (e.FolderBrowserMessage == FolderBrowserMessage.ValidateFailed)

{

e.Dismiss = e.Path != "NONE";

}

}
Private Sub folderBrowser1_BrowseCallback(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.FolderBrowserCallbackEventArgs)

' We can log the events and Folder Browser Message to the Label control.

Me.label1.Text = String.Format("Event: {0}, Path: {1}", e.FolderBrowserMessage, e.Path)

If e.FolderBrowserMessage = FolderBrowserMessage.ValidateFailed Then

e.Dismiss = e.Path <> "NONE"

End If

End Sub