hi. how can i provide F1 help support to .Net application.
the application consist of several form with many fields. so i dont want to drop HelpProvider control on each form and set the properties. please tell me any component that can handle this.
hi. how can i provide F1 help support to .Net application.
the application consist of several form with many fields. so i dont want to drop HelpProvider control on each form and set the properties. please tell me any component that can handle this.
For WPF, you may do the following:
CommandBinding HelpBinding = new CommandBinding(
ApplicationCommands.Help,
ShowHelpHandler,
CanShowHelpHandler);
CommandManager.RegisterClassCommandBinding(typeof(Window), HelpBinding);
where ShowHelpHandler
and CanShowHelpHandler
are declared as
static void ShowHelpHandler(object sender, ExecutedRoutedEventArgs e)
{
...
}
static void CanShowHelpHandler(object sender, CanExecuteRoutedEventArgs e)
{
...
}
This will register Help command bound to F1 at all windows.
I suppose you could implement a class that inherits Form and adds a HelpProvider, then inherit your forms from that class. That way, you'd only have to set the properties
Form -> AppFormBase -> ConcreteForm
Public Class AppFormBase
Inherits Form ' Your original base class
Public Sub New()
' Add HelpProvider to Me.Controls
End Sub
End Class
Public Class MyActualForm ' Your original form.
Inherits AppFormBase
End Class