1. Yet Another Win32Lib UI question

My UI is coming along nicely, thanks to everybody's help.

Another simple question: I have a text box that I enable and disable based on
other controls.  It appears that once it is disabled, when it is re-enabled the
background color remains the color of when it was disabled (light grey), rather
than white (which is the background color for all text boxes that are enabled
from the beginning and never disabled.  This actually happens on both text boxes
and combo boxes.

I have tried a number of combinations of commands that I think should do the
trick I found in Win32Lib, but none of them worked.  My guess was that some form
of:

setPenBkMode( TheWindow, OPAQUE)
setBackColor( TheWindow, Gray )

would have done it, but it doesn't.

Is there a command or series of command I can issue right after a control is
enabled to change its background color to white, so it looks truly enabled?

Mike

new topic     » topic index » view message » categorize

2. Re: Yet Another Win32Lib UI question

Mike777 wrote:
> 
> My UI is coming along nicely, thanks to everybody's help.
> 
> Another simple question: I have a text box that I enable and disable based on
> other controls.  It appears that once it is disabled, when it is re-enabled
> the background color remains the color of when it was disabled (light grey),
> rather than white (which is the background color for all text boxes that are
> enabled from the beginning and never disabled.  This actually happens on both
> text boxes and combo boxes.
> 
> I have tried a number of combinations of commands that I think should do the
> trick I found in Win32Lib, but none of them worked.  My guess was that some
> form of:
> 
> setPenBkMode( TheWindow, OPAQUE)
> setBackColor( TheWindow, Gray )
> 
> would have done it, but it doesn't.
> 
> Is there a command or series of command I can issue right after a control is
> enabled to change its background color to white, so it looks truly enabled?
> 
> 
> Mike

I'll check this later.
But the expected way to change the background of a control is
setWindowBackColor(control,color). setBackColor() affects the text you write
after issuing it, not the background.

CChris

new topic     » goto parent     » topic index » view message » categorize

3. Re: Yet Another Win32Lib UI question

Mike777 wrote:
> 
> My UI is coming along nicely, thanks to everybody's help.
> 
> Another simple question: I have a text box that I enable and disable based on
> other controls.  It appears that once it is disabled, when it is re-enabled
> the background color remains the color of when it was disabled (light grey),
> rather than white (which is the background color for all text boxes that are
> enabled from the beginning and never disabled.  This actually happens on both
> text boxes and combo boxes.
> 
> I have tried a number of combinations of commands that I think should do the
> trick I found in Win32Lib, but none of them worked.  My guess was that some
> form of:
> 
> setPenBkMode( TheWindow, OPAQUE)
> setBackColor( TheWindow, Gray )
> 
> would have done it, but it doesn't.
> 
> Is there a command or series of command I can issue right after a control is
> enabled to change its background color to white, so it looks truly enabled?
> 

This will set the background color to the default:

setWindowBackColor( YourTextCtrl, getSysColor(COLOR_WINDOW) )


-Greg

new topic     » goto parent     » topic index » view message » categorize

4. Re: Yet Another Win32Lib UI question

Greg Haberek wrote:
> 
> Mike777 wrote:
> > 
> > My UI is coming along nicely, thanks to everybody's help.
> > 
> > Another simple question: I have a text box that I enable and disable based
> > on
> > other controls.  It appears that once it is disabled, when it is re-enabled
> > the background color remains the color of when it was disabled (light grey),
> > rather than white (which is the background color for all text boxes that are
> > enabled from the beginning and never disabled.  This actually happens on
> > both
> > text boxes and combo boxes.
> > 
> > I have tried a number of combinations of commands that I think should do the
> > trick I found in Win32Lib, but none of them worked.  My guess was that some
> > form of:
> > 
> > setPenBkMode( TheWindow, OPAQUE)
> > setBackColor( TheWindow, Gray )
> > 
> > would have done it, but it doesn't.
> > 
> > Is there a command or series of command I can issue right after a control is
> > enabled to change its background color to white, so it looks truly enabled?
> > 
> 
> This will set the background color to the default:
> 
> }}}
<eucode>
> setWindowBackColor( YourTextCtrl, getSysColor(COLOR_WINDOW) )
> </eucode>
{{{


Thanks to you and Chris.

And, yes, the docs do have this information.  No, I don't know how I could have
missed it the first time through.  I can blame sleep deprivation!

Mike

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu