Help with a HelpButton
-
It may belong under WTF or Soapbox, but I just found this:
The value of the HelpButton property is ignored if the Maximize or Minimize buttons are shown.
:mad: Does anyone here have an easy workaround that allows all three buttons to be on the Caption Bar? (Using .net 2.0)
-
It may belong under WTF or Soapbox, but I just found this:
The value of the HelpButton property is ignored if the Maximize or Minimize buttons are shown.
:mad: Does anyone here have an easy workaround that allows all three buttons to be on the Caption Bar? (Using .net 2.0)
It's not an easy workaround: you'll need to paint it on the title bar yourself. For that you need to handle the
WM_NCPAINT
andWM_NCHITTEST
messages. SeeDrawFrameControl
for how to draw a Windows 2000-style help button (DFC_CAPTION
andDFCS_CAPTIONHELP
) andDrawThemeBackground
/DrawThemeIcon
(partWP_HELPBUTTON
and the appropriate state) for Windows XP-style themed buttons. For Windows Vista it probably won't work very well since Aero draws the title bars normally, if in 3D mode; if you handleWM_NCPAINT
it will turn off the standard frame painting for that window, I believe. You'd probably have to start playing with the Glass API to make it still look like a Windows Vista window. The limitation is from Windows itself: the documentation forCreateWindowEx
says "WS_EX_CONTEXTHELP
cannot be used with theWS_MAXIMIZEBOX
orWS_MINIMIZEBOX
styles." In other words, Microsoft did not intend it to be used like this. Edit: yes, I realise this is the Windows Forms forum. You need to override theWndProc
method to handle messages that Windows Forms doesn't already translate to method calls/events.Stability. What an interesting concept. -- Chris Maunder