Article View: comp.os.ms-windows.programmer.misc
Article #2102Re: HELP with user draw buttons
From: Tom W. Brown
Date: Tue, 17 Nov 1992 22:46
Date: Tue, 17 Nov 1992 22:46
32 lines
2258 bytes
2258 bytes
In article <1992Nov17.025140.21367@riacs.edu>, ngorelic@speclab.cr.usgs.gov.cr.usgs.gov (Noel S. Gorelick) writes: |> Talib K. Morgan (tmorgan@andromeda.rutgers.edu) wrote: |> : I would like to create a user draw push button that would appear clear to the |> : user of the program until they click on that button. Could someone tell if |> : this is possible. The userbutton, to the user, would only appear to contain |> : text. It would be really nice if I could make the pushbutton any color that I |> : chose. Is this possible? |> |> If its not in a dialog box, it is trivial... Just put up a window where you |> want it, with whatever you want in it, and no border... It can be made |> to appear transparent. Then just process mouse messages. |> |> If its in a dialog, you will need a custom control... Outta my experence. |> (If you are using borland, though, their custom controls allow this |> quite easily.) In both cases I believe a BS_OWNERDRAW style button will do what you want without having to handle mouse messages yourself in the first case or having to build a complete custom control in the second (which, actually, is really the same thing). The owner of the button responds to the WM_MEASUREITEM message to tell Windows how big the button is and responds to WM_DRAWITEM messages to paint the button -- you can do anything you wish to display the button, make it clear, any color, put text in it, etc. ---------------------------------------------------------------------------- Tom Brown | "'ow d'you know 'e's a king? PE Nelson Systems | 'cause 'e 'asn't got shit all over 'im!" twbrown@pe-nelson.com | Monty Python and the Holy Grail ----------------------------------------------------------------------------
Technical Details
Message-ID:
<695@lax.lax.pe-nelson.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrownReferences:
<Nov.16.16.15.12.1992.29842@andromeda.rutgers.edu> <1992Nov17.025140.21367@riacs.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown From: twbrown@PE-Nelson.COM (Tom W. Brown) Newsgroups: comp.os.ms-windows.programmer.misc Subject: Re: HELP with user draw buttons Message-ID: <695@lax.lax.pe-nelson.com> Date: 17 Nov 92 22:46:57 GMT References: <Nov.16.16.15.12.1992.29842@andromeda.rutgers.edu> <1992Nov17.025140.21367@riacs.edu> Sender: news@lax.pe-nelson.com Organization: PE-Nelson Lines: 32