1. newbie: Win32Lib: change BACKGROUND color of CONTROL(s)?

Dave,

I like your "Design" effort; I'm trying to use it to make a program
skeleton, then flesh it out outside of Design.

 In Win32Lib, how can I specify the BACKGROUND COLOR of a CONTROL (like a
label or button)?  I've tried "setBackColor", & even "setWindowBackColor",
with no luck.

Dan Moyer

new topic     » topic index » view message » categorize

2. Re: newbie: Win32Lib: change BACKGROUND color of CONTROL(s)?

Dan Moyer wrote:

> In Win32Lib, how can I specify the BACKGROUND
> COLOR of a CONTROL (like a label or button)?  I've
> tried "setBackColor", & even "setWindowBackColor",
> with no luck.

I was a bit suprised to find that feature lacking, but I'm going to guess
that I actually had a reason for doing that, like respecting the color theme
that the user selected. In a weak attempt to justify my action, I'll mention
that I can't think of any program I've recently used that changed the color
of any of it's buttons...

Win32Lib actually does sets the background colors for buttons (apparent when
you work with radio and check boxes) and static controls (such as labels),
but only so they match the color of the parent window.

I'm not against adding it, however. Is there a compelling reason you can
think of for it?

Thanks!

-- David Cuny

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

3. Re: newbie: Win32Lib: change BACKGROUND color of CONTROL(s)?

David Cuny wrote:

> Dan Moyer wrote:
>
> > In Win32Lib, how can I specify the BACKGROUND
> > COLOR of a CONTROL (like a label or button)?  I've
> > tried "setBackColor", & even "setWindowBackColor",
> > with no luck.
>
> I was a bit suprised to find that feature lacking, but I'm going to guess
> that I actually had a reason for doing that, like respecting the color theme
> that the user selected. In a weak attempt to justify my action, I'll mention
> that I can't think of any program I've recently used that changed the color
> of any of it's buttons...
>
> Win32Lib actually does sets the background colors for buttons (apparent when
> you work with radio and check boxes) and static controls (such as labels),
> but only so they match the color of the parent window.
>
> I'm not against adding it, however. Is there a compelling reason you can
> think of for it?
>

Not one single reason....except that it looks pretty!

And plus, new programmers are always drawn to a language by things like that...
"Wow, you mean I can actually change the color of those buttons! Nifty!"

It's definitely not a Must Have item, but I think it does fall under the Neat
Things categroy.

>
> Thanks!
>
> -- David Cuny

Greg Phillips

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

4. Re: newbie: Win32Lib: change BACKGROUND color of CONTROL(s)?

Greg Phillips wrote:

>> I'm not against adding [colored buttons], however.
>> Is there a compelling reason you can think of for it?
>
> Not one single reason....except that it looks pretty!

A lot of features are like that. Tooltips fall into that category - they are
great on icons that don't have room to display text, but outside that, they
quickly get irritating.

-- David Cuny

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

5. Re: newbie: Win32Lib: change BACKGROUND color of CONTROL(s)?

Dave,

Well, I can't honestly think of a really compelling reason to add "change
color of control", it was just the first thing I thought of doing for a
"math flash card" program I'm writing.

It has a big button as a "card" for the problem & answer (in large font) so
the user can click on it to change to the next "card", but since  a button
only accepts text to the middle, I put a few labels "over" it for the
numbers, but the labels won't take the same color as the button so they
stand out in differently colored blocks, which isn't too good.

If I could think of how to put the problem numbers into separate lines on
one label (which is probably easy), that would work since it would all be
one color, but putting each number into a separate label was easier for me,
that's why I thought to just change their background color.

Dan Moyer

On Fri, 17 Sep 1999 08:00:52 -0700, David Cuny <dcuny at LANSET.COM> wrote:

>Dan Moyer wrote:
>
>> In Win32Lib, how can I specify the BACKGROUND
>> COLOR of a CONTROL (like a label or button)?  I've
>> tried "setBackColor", & even "setWindowBackColor",
>> with no luck.
>
>I was a bit suprised to find that feature lacking, but I'm going to guess
>that I actually had a reason for doing that, like respecting the color
theme
>that the user selected.
> <snip>
>I'm not against adding it, however. Is there a compelling reason you can
>think of for it?
>
>Thanks!
>
>-- David Cuny

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

6. Re: newbie: Win32Lib: change BACKGROUND color of CONTROL(s)?

Dan Moyer wrote:

> It has a big button as a "card" for the problem
> & answer (in large font) so the user can click on
> it to change to the next "card" ...

I suspect that the best solution would be to draw the whole thing by hand,
and perform hit testing on the window to see if a click falls into the card.
It would give you a lot more flexibility over what the card looked like as
well. Just a thought.

-- David Cuny

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

Search



Quick Links

User menu

Not signed in.

Misc Menu