customizing how the help button works

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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, but I was wondering if I can
override this behavior so when someone clicks this button it just opens a new
dialog with general info of that dialog. I want to do this because I don't
want to take up any space in my dialog with a menu or a new icon... and this
button in the title bar would be perfect! I just don't want that whole
point-to-a-control-to-get-help routine.
 
MrNobody said:
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, but I was wondering if I can
override this behavior so when someone clicks this button it just opens a
new
dialog with general info of that dialog. I want to do this because I don't
want to take up any space in my dialog with a menu or a new icon... and
this
button in the title bar would be perfect! I just don't want that whole
point-to-a-control-to-get-help routine.

If you really want to do this, you can override the form's WndProc to
intercept the message generated when the button is pressed, as in the
example below, but bear in mind that your application will then not behave
as an experienced Windows user will expect.

protected override void WndProc(ref Message m) {
const int WM_SYSCOMMAND = 0x0112;
const int SC_CONTEXTHELP = 0xF180;

if (m.Msg == WM_SYSCOMMAND && ((int)m.WParam & 0xFFF0) ==
SC_CONTEXTHELP) {
MessageBox.Show("Display a help dialog here");
m.Result = IntPtr.Zero;
}
else
base.WndProc(ref m);
}

Chris Jobson
 
Back
Top