473,394 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to write a help button?

Hi,

Actually, I want to write a Help button: after clicking the help button i want the cursor to became question mark and then user will click any button or textbox or any thing in the form and another window will be opened and gives information about the clicked parts.

I wonder if it is possible.

Thank you so much,
Negar
Sep 1 '10 #1
1 3948
GaryTexmo
1,501 Expert 1GB
This should be fairly easy to do... I've never done it before, but I have an idea so lets dive in and figure it out together :)

I'll start with a rough outline... you've got a form with controls on it. I believe every single control has an event for "Click". So that means you can do something when a control is clicked.

We also know that we want a help mode state that we can toggle on or off that we can preserve for that particular class.

So we can design a state...
Expand|Select|Wrap|Line Numbers
  1. enum FormState
  2. {
  3.   Normal,
  4.   Help
  5. }
We can then create a class member of this type and default it to the normal state. Now, whenever we click a control, in the event handler we can check the state and take an action based on what that state is.

If the state is help, we can display help for that control. If it's normal, we can take whatever action we normally would.

The event handlers might look like this...

For the Help button...
Expand|Select|Wrap|Line Numbers
  1. private void HelpButton_Click(object sender, EventArgs e)
  2. {
  3.   if (e is Button)
  4.   {
  5.     if (m_formState == FormState.Help)
  6.       m_formState = FormState.Normal;
  7.     else
  8.       m_formState = FormState.Help;
  9.   }
  10. }
(Note, you may also want to change the form's cursor)

Then for a text box's click event you may want to have the following in the event handler...
Expand|Select|Wrap|Line Numbers
  1. if (m_formState == FormState.Help)
  2.   DisplayHelp();
  3. else
  4.   DoWhateverWeDoOnTextBoxClick();
  5.  
Hopefully that helps and gets you started.
Sep 2 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Abhi | last post by:
How can i add a Help button (button with ? mark on it) on the title bar of an application in C#.
2
by: satish | last post by:
Ppl, We have a help button on the title bar. Instead of clicking on the title bar and then on one of the controls to launch the help, We want to be able to launch the help file directly on...
0
by: satish | last post by:
I have the help button shown on the tool bar. Instead of providing the pop-up help i.e clicking the help button and then some control to display the help, I want to be able to launch the help...
1
by: MrNobody | last post by:
using .NET IDE I can add a help button to the top right of the title bar next to minimize/mazimize/close. This button lets the user point to a specific control and then get help on that control,...
4
by: ZhangZQ | last post by:
how to remove the apply and help button from propertysheet? I tried to this->m_psh.dwFlags &= ~PSH_HASHELP; this->m_psh.dwFlags |= PSH_NOAPPLYNOW; this->m_psh.dwFlags |= PSH_NOCONTEXTHELP; ...
1
by: Danielle Robinson | last post by:
Okay I am using a MDI where different windows forms open up on menu command (made with vb.net). The forms open up maximised so the control box is in the mdi. This means that if I have a help button...
0
by: Archie Graham | last post by:
In a 2003 VB.Net windows-based app, if your form has the Maximize Box and/or Minimize Box properties set to True, then the Help Button is not displayed. Is it possible to move the "What's This" Help...
2
by: Xero | last post by:
hello and merry christmas guys, how can i determine if the user has clicked the Help button on a dialog box with such button so that i can display a help file to him / her? thanks. -- Xero
1
by: gusma728 | last post by:
I want to remove the "What's this?" help button from the title bar in a dialog of the ....Forms.OpenFileDialog class. How can I do this? I can set a property ShowHelp to false but that doesn't...
0
by: ARC | last post by:
Hello all, I've searched everywhere for this, and no luck. When you create a runtime, the small round help button does nothing when you click it. Does anyone know how to get it to launch your...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.