Re: Win32Lib: Button Color
- Posted by Don <eunexus at yahoo.com> Jul 14, 2004
- 605 views
> > > This effect happens because the clearWindow call drawns a colored > > > rectangle > > > over the button area, but as soon as Windows gets any event for the button > > > it redraws the button 'correctly'. > > > > > > There are two main ways to get colored buttons. > > > (1) Define it as an owner-drawn button and handle the special messages > > > (meaning: You do all the graphic work, but you're told when and what to > > > do). > > > > > > (2) Simulate a button with a simple child window. You still get to > > > do all the graphics, and you must handle all the keyboard and > > > mouse events too. > > > > How about using the on paint event? > > I tried. Windows redraws the button while its depressed. Your app only gets > paint events when it is not depressed. Its all quite depressing really. Nods, it wont work unless the control is completely owner-drawn. If alot of people would be interested in colored buttons, I could always create some easy to use versions in xControls... its what its for after all =) It might take me awile to code them up, but send me email to EuNexus at yahoo.com if this is something you would like to have added. Don Phillips - aka Graebel National Instruments mailto: eunexus @ yahoo.com