Link to home
Start Free TrialLog in
Avatar of dominicwong
dominicwong

asked on

Contextual Help System in C#

Hi experts

I am developing a Windows application in C# using VS2008.

In my application, there is a top and a bottom panel. There are many tabs at the top panel, and each tab contains many controls such as text box, combo box, datagridview, etc.

What I would like to do is to provide user with contextual help so that when user clicks or hovers any of the controls at the top panel, a Help text will be displayed at the bottom panel.

I am about to read the book "Pro .NET 2.0 Windows" but this book was already 6 yrs old, and is for .NET 2.0. I searched Expert-Exchange database, and I found the following link but it is for VB.
https://www.experts-exchange.com/questions/26194451/Contextual-Help.html

Could someone please point to me the right direction as I am doing it in C# and VS2008 (.NET 3.5). Thanks in advance.
Avatar of kaufmed
kaufmed
Flag of United States of America image

I am about to read the book "Pro .NET 2.0 Windows" but this book was already 6 yrs old, and is for .NET 2.0.
2.0 is the foundation for all other Framework versions save 1.0 and 1.1. The HelpProvider is still available for your 3.5 projects.

If you want to use code from the link, you could translate most of it with an online code converter; whatever doesn't translate cleanly (or that which you may want to confirm) you could post here and we could review it for you.
With the HelpProvider, you get something like this (written in 4.0):

User generated image
Avatar of dominicwong
dominicwong

ASKER

Thanks kaufmed for your prompt response and illustration.

I think HelpProvider will not do what I am after.
It is because my descriptive text can be 30 or 40 lines of text. That is why I want them to be displayed in a separate panel at the bottom.

By the way, in some cases, I also need to display a photograph along with the Help text as part of the Help menu.
Controls have a MouseEnter event that fires when the mouse cursor gets over the control, and a MouseLeave when the cursor leaves the control.

You could set the text in your panel on MouseEnter and remove it on MouseLeave.
Thanks James.
Rather than to go Control by Control, I am after a systematic approach that allows me to implement a Contextual Help system. Therefore, while responding to Mouse events, I would like to know how best to implement that Help system.

PS. I have over a hundred controls in my application.
SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks James to your suggestion. I am concerned that implementation might create a tight coupling between the Control and the Help System. Also, in my Help System, there will have picture along with text.

Thanks nishant to your suggestion. I had glimpsed over the book "Pro .NET 2.0 Windows" and it looks like html document is one good alternative. My application is a PC application though. Is this webbrowser control applicable in my situation?
BTW, is it possible to have picture included with this approach?
Seems that you are look for full help, not a simple thing. Integrating images in the text will take space. If you try to display it in a Panel inside the Form, either there won't be much space left for the Form itself, or the help panel will become a scrolling nightmare.

Have you looked for help development software? Microsoft used to have one that integrated into your solution in Visual Studio 2003, but I do not think they have it for new versions. A few companies sell such software. One of them is RoboHelp from Adobe. I do not have a need for full fledged help systems in my current applications, so I have not used it in .NET, but I used an earlier version in the old pre-.NET days and it was a good and solid product.
Thanks James for your prompt response.

Yes, the software I am developing requires a full Help system.
Space probably won't be an issue as I have one panel fully dedicated for displaying Help text.

No, I hadn't looked into any commerical help development software. Budget is tight. :(
Was emoreau's article mentioned in the link you originally posted of any use? Even though the project is VB, you could a) convert the code to C#  b) compile the code as a VB assembly and reference the assembly in your C# project.
Thanks kaufmed.
No, I haven't tried the approach suggested in the link I mentioned as I was hoping that someone might have an answer for C# (I don't know VB).
Don't be shy about VB vs C#. The framework does the job, so what works in one language works the same way in the other one. Only the syntax is different. And while VB programmers have problems understanding the C# syntax, the reverse is not True. Any programmer worth his 15 cents can understand a VB program if he understands the framework.
Thanks James. I will give it a go.
Hi nishant, kaufmed, and James
I'd read a little bit about the "Pro .NET 2.0 Windows" book. The approach in the book is what nishant had suggested. It uses Webbrowser Control with individual separated html files.

My question is: can I use Webbroswer Control with one single chm file (which contains many topics)?

I'd done a search within Experts-Exchange.
In https://www.experts-exchange.com/questions/24327877/ShowHelp-with-WebBrowser.html, the expert says it is not so easy. The link to his suggestion by using a C# approach is not valid.

I wonder if you guys or anyone might have an idea how I might use Webbrowser Control with one single chm file (instead of multiple html files)? Thanks.
Close this and re-open a new more specific question.