'宣言 Public Delegate Sub NavigationOptionsDialogDisplayingEventHandler( _ ByVal sender As Object, _ ByVal e As CancelableNavigationOptionsDialogDisplayingEventArgs _ )
public delegate void NavigationOptionsDialogDisplayingEventHandler( object sender, CancelableNavigationOptionsDialogDisplayingEventArgs e )
Imports System.Diagnostics Imports Infragistics.Win Imports Infragistics.Win.UltraWinExplorerBar Dim WithEvents dialogResetButton As Button Private Sub UltraExplorerBar1_NavigationOptionsDialogDisplaying(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinExplorerBar.CancelableNavigationOptionsDialogDisplayingEventArgs) Handles UltraExplorerBar1.NavigationOptionsDialogDisplaying ' To prevent the NavigationPaneOptionsDialog from displaying, uncomment the following line. 'e.Cancel = true ' If we haven't cancelled the dialog, enable the dialog's Reset button and listen to its Click event. If e.Cancel = False Then e.Dialog.ResetButton.Visible = True Me.dialogResetButton = e.Dialog.ResetButton Else ' Since we have cancelled the display of the built-in NavigationPaneOptionsDialog, display our ' own options dialog. Dim myNavigationOptionsDialog As MyNavigationOptionsDialog = New MyNavigationOptionsDialog() myNavigationOptionsDialog.ShowDialog(Me) End If End Sub Private Sub MyResetButtonEventHandler(ByVal sender As Object, ByVal e As EventArgs) Handles dialogResetButton.Click ' Perform custom reset processing here. End Sub Public Class MyNavigationOptionsDialog Inherits System.Windows.Forms.Form End Class
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinExplorerBar; private void ultraExplorerBar1_NavigationOptionsDialogDisplaying(object sender, Infragistics.Win.UltraWinExplorerBar.CancelableNavigationOptionsDialogDisplayingEventArgs e) { // To prevent the NavigationPaneOptionsDialog from displaying, uncomment the following line. //e.Cancel = true; // If we haven't cancelled the dialog, enable the dialog's Reset button and listen to its Click event. if (e.Cancel == false) { e.Dialog.ResetButton.Visible = true; e.Dialog.ResetButton.Click += new EventHandler(this.MyResetButtonEventHandler); } else { // Since we have cancelled the display of the built-in NavigationPaneOptionsDialog, display our // own options dialog. MyNavigationOptionsDialog myNavigationOptionsDialog = new MyNavigationOptionsDialog(); myNavigationOptionsDialog.ShowDialog(this); } } private void MyResetButtonEventHandler(object sender, EventArgs e) { // Perform custom reset processing here. } public class MyNavigationOptionsDialog : Form { }