Search code examples
c#winformscontext-sensitive-help

Good way to add context-sensitive help to an existing Windows Forms application?


I have to add database-driven tooltips to an existing WinForms App, big one. C# and .NET 3.5

I'd like to avoid having to drop new controls for this, and the user has to be able to edit the help tooltips.

My best guess is to wrap the existing controls in a new type that contains new properties, so that I can assign a new property like "FieldHelpName", and can use that in the administrative module so the user can identify the field clearly. I'd assign a ScreenID to each form and each FieldHelpName record would be linked to a ScreenID. At application startup, load all the help contents, and on form-load, filter by its ScreenID and add the corresponding tooltips using reflection, most likely.

I'm looking for suggestions on how to do this process best or to know if there are any best practices on how to do this...so any help is really appreciated. Thanks.


Solution

  • Ended up creating a database table for configuration and specifying control name for each row, and then looping screen controls recursively to add tooltips if the current control name matches the database record's control name.