473,385 Members | 1,569 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,385 software developers and data experts.

How to simulate HelpButtonClicked event

I'm working on an windows application, framework 2, language c#. I'm
debugging on Windows Vista and XP.

I need to have the [?] button in the caption bar, but also minimize
box and maximize box.
The only way to have the [?] button visible is to disable minimize and
maximize box. Okay, this is by design, but this is not acceptable to
me, so I need to find another solution.
The idea is to put another button, a normal button called "buttonHelp"
in a conner of my app, that simply enables the "what's this" mode. In
other words I want that after clicking it, the mouse cursor appear
with a small ?, and that clicking any control on the form is shown his
help description.

-------------First idea:

private void buttonHelp_Click(object sender, EventArgs e)
{
OnHelpButtonClicked(new CancelEventArgs(false));

}

protected override void OnHelpButtonClicked(CancelEventArgs e)
{
base.OnHelpButtonClicked(e);

}

It does not work.

-------------Second idea:

private const int WM_SYSCOMMAND = 0x0112;
private const int SC_CONTEXTHELP = 0xF180;

DllImport("User32.dll")]
public static extern Int32 SendMessage(IntPtr hWnd, UInt32 Msg, UInt32
wParam, Int32 lParam);

private void buttonHelp_Click(object sender, EventArgs e)
{
unsafe
{
SendMessage(this.Handle, WM_SYSCOMMAND, SC_CONTEXTHELP, 0);
}

}

It does not work, even if the event OnHelpButtonClicked is thrown and
overriding the WndProc event i see that both the real [?] button and
my button seems to have sent the same message (the only difference is
lparam, that should be ignored being the mouse position)

--------------------------------------------

Does anybody have an idea?
I cannot believe that is impossible to have a button that simply put
the app in "what's this" mode if I have maximize and minimize box. I'm
going mad... ;-)

Thank you in advance
Nov 20 '07 #1
0 1243

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Luis Faisco | last post by:
Hi, my problem may be trivial but I have been searching for an answer to this on the web without success. Hope you can help. This is the scenario: I am making a wizard composed of several...
1
by: charliewest | last post by:
I am trying use server controls or web controls to simulate the following behavior. I've an image wrapped w/in a link to create a rollover effect as if both elements we're one graphic: <a...
4
by: johnny | last post by:
On a form I would like to simulate a button click when the Enter is pressed. My form is setup and it works if the delegate for the key pressed on the form calls the delegate for the button pressed....
3
by: Maileen | last post by:
Hi, I would like to know how to simulate an event in VB.NET ? in fact, for example when user press enter in some special textbox, i would like to raise a listview column click (for example). ...
2
by: Ryan Liu | last post by:
Can someone give a sample to prevent a row from being deleted in a datatable? I tried e.Row.RejectChanges(); in dt_RowDeleting() but seems does not work. I need verify if there other data...
8
by: Doug Marquardt | last post by:
Hi All: I want to simulate VB6 Autoredraw in VB.Net I figure I would probably have to create a memory dc, paint to that, and then create a bitmap based on the dc and copy that image into a...
1
by: melton9 | last post by:
I've been searching around and haven't really found anything. I've but an IE browser on my form and would like to simulate clicking the provided refresh button on a one minute interval. I can't...
6
by: Charles Law | last post by:
I have a base class and derived classes that relate to a set of documents I process. e.g. DocBase, DocA, DocB, DocC. The processing of each document is handled in teh derived classes, as you might...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.