ForeColor & BackColor on Labels & Buttons

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

Hi folks!

I'm new to this forum. I've programmed in VB starting
w/VB1 about 9 years ago! ;) Certainly most time spent
in VB6. Now trying to make the leap to VB.NET. Much
harder than I thought it would be. For now, I need to
know how to change the foreground and background colors
on labels and buttons. I used to be able to do this in
VB6 but cannot seem to get it to work in VB.NET. Any
suggestions will be greatly appreciated!

Jim/
 
Jim said:
I'm new to this forum. I've programmed in VB starting
w/VB1 about 9 years ago! ;) Certainly most time spent
in VB6. Now trying to make the leap to VB.NET. Much
harder than I thought it would be. For now, I need to
know how to change the foreground and background colors
on labels and buttons. I used to be able to do this in
VB6 but cannot seem to get it to work in VB.NET. Any
suggestions will be greatly appreciated!

The Forecolor and Backcolor properties are still there in VB.NET.
 
Well, yes they are there, but they don't work ;)

ForeColor of the label works but BackColor doesn't and
NEITHER work on a Button... What am I doing wrong?
Another guy told me there was a fix coming in SP2 to fix
this problem. Anyone heard anything about that?

Jim/
 
Well, yes they are there, but they don't work ;)

ForeColor of the label works but BackColor doesn't and
NEITHER work on a Button... What am I doing wrong?

I don't know because I don't know _what_ you are doing.
Another guy told me there was a fix coming in SP2 to fix
this problem. Anyone heard anything about that?

I have no problem setting the backcolor in VB 2003, Framework 1.1, Win XP
Prof./SP1

AFAIK SP2 is only available for Framework 1.0 and there is no SP for
Framework 1.1. (AFAIR)
 
In my haste to get the question posted, I neglected to tell
that I'm developing an app to run on the *compact framework*
on a CE device. Maybe THAT's where the deficiency is??

lblA1.ForeColor = System.Drawing.Color.RoyalBlue
lblA1.BackColor = System.Drawing.Color.Cyan

cmdB1.BackColor = System.Drawing.Color.Cyan
cmdB1.ForeColor = System.Drawing.Color.Red

ONLY the first line of code has any effect on the objects.

Jim/
 
Jim said:
In my haste to get the question posted, I neglected to tell
that I'm developing an app to run on the *compact framework*
on a CE device. Maybe THAT's where the deficiency is??

Maybe. I don't know, sorry.
lblA1.ForeColor = System.Drawing.Color.RoyalBlue
lblA1.BackColor = System.Drawing.Color.Cyan

cmdB1.BackColor = System.Drawing.Color.Cyan
cmdB1.ForeColor = System.Drawing.Color.Red

ONLY the first line of code has any effect on the objects.

Tried it here without a problem. Maybe you are starting a process directly
after changing the color? If you do, Win does not have the time to repaint
the controls.
 
Well, it's all about the *compact framework*!!
You are correct. It works fine for a standard desktop
app. Doesn't work for a CE.NET app! :(

Thanks MS!

Jim/
 
Armin,

I realize you can't help with the CF but just knowing
what the problem is is helpful to me :)

Thanks!

Jim/

P.S. For anyone else interested, there will be a service
pack for the CF to solve this problem in the near future.
 
The same problem exists in the CF developing in C

----- Jim wrote: ----

Armin

I realize you can't help with the CF but just knowin
what the problem is is helpful to me :

Thanks

Jim

P.S. For anyone else interested, there will be a servic
pack for the CF to solve this problem in the near future
 
Back
Top