Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. Help with a HelpButton

Help with a HelpButton

Scheduled Pinned Locked Moved Windows Forms
csharphelpquestion
2 Posts 2 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PIEBALDconsult
    wrote on last edited by
    #1

    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)

    M 1 Reply Last reply
    0
    • P PIEBALDconsult

      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)

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      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 and WM_NCHITTEST messages. See DrawFrameControl for how to draw a Windows 2000-style help button (DFC_CAPTION and DFCS_CAPTIONHELP) and DrawThemeBackground/DrawThemeIcon (part WP_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 handle WM_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 for CreateWindowEx says "WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_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 the WndProc method to handle messages that Windows Forms doesn't already translate to method calls/events.

      Stability. What an interesting concept. -- Chris Maunder

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups