0

I would like to provide Help when a developer press F1 in design-time when my user-control has focus. By default the Visual Studio help opens, but I would like to open my own online help.

I know you can use a custom designer for a user-control but it's a lot work for a simple task as opening an online help.

Does anyone has experience with this?

Thanks in advance.

Devbg
  • 1
  • 1

1 Answers1

-1

Use the "HelpRequested" event of your control:

button1.HelpRequested += button1_HelpRequested;

and the implementation:

private void button1_HelpRequested(object sender, HelpEventArgs hlpevent)
{
   Help.ShowHelp(this, "helpFile.chm", HelpNavigator.TopicId, "1234");
}
Nissim
  • 6,395
  • 5
  • 49
  • 74
  • Hi Nissim, does this work in design-time? I think this would only work in run-time. – Devbg Aug 13 '15 at 11:47
  • @Devbg In design-time your code doesn't actually run. In order to override VS's 'F1' @ design time you will probably need to develop a VS extension. maybe the following could help: http://stackoverflow.com/questions/13942657/visual-studio-intercepting-f1-help-command – Nissim Aug 13 '15 at 15:05