home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / mswindo / programm / misc / 3496 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  2.2 KB

  1. Path: sparky!uunet!lax.pe-nelson.com!lax!twbrown
  2. From: twbrown@PE-Nelson.COM (Tom W. Brown)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: HELP with user draw buttons
  5. Message-ID: <695@lax.lax.pe-nelson.com>
  6. Date: 17 Nov 92 22:46:57 GMT
  7. References: <Nov.16.16.15.12.1992.29842@andromeda.rutgers.edu> <1992Nov17.025140.21367@riacs.edu>
  8. Sender: news@lax.pe-nelson.com
  9. Organization: PE-Nelson
  10. Lines: 32
  11.  
  12. In article <1992Nov17.025140.21367@riacs.edu>, ngorelic@speclab.cr.usgs.gov.cr.usgs.gov (Noel S. Gorelick) writes:
  13. |> Talib K. Morgan (tmorgan@andromeda.rutgers.edu) wrote:
  14. |> : I would like to create a user draw push button that would appear clear to the 
  15. |> : user of the program until they click on that button.  Could someone tell if 
  16. |> : this is possible.  The userbutton, to the user, would only appear to contain
  17. |> : text.  It would be really nice if I could make the pushbutton any color that I
  18. |> : chose.  Is this possible?
  19. |> 
  20. |> If its not in a dialog box, it is trivial...  Just put up a window where you
  21. |> want it, with whatever you want in it, and no border...  It can be made
  22. |> to appear transparent.  Then just process mouse messages.
  23. |> 
  24. |> If its in a dialog, you will need a custom control...  Outta my experence.
  25. |> (If you are using borland, though, their custom controls allow this
  26. |>  quite easily.)
  27.  
  28. In both cases I believe a BS_OWNERDRAW style button will do what you want
  29. without having to handle mouse messages yourself in the first case or
  30. having to build a complete custom control in the second (which, actually,
  31. is really the same thing).
  32.  
  33. The owner of the button responds to the WM_MEASUREITEM message to tell Windows
  34. how big the button is and responds to WM_DRAWITEM messages to paint the
  35. button -- you can do anything you wish to display the button, make it clear,
  36. any color, put text in it, etc.
  37.  
  38.  
  39. ----------------------------------------------------------------------------
  40. Tom Brown               |  "'ow d'you know 'e's a king?
  41. PE Nelson Systems       |            'cause 'e 'asn't got shit all over 'im!"
  42. twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
  43. ----------------------------------------------------------------------------
  44.