473,508 Members | 3,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ForeColor & BackColor on Labels & Buttons

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/

Nov 20 '05 #1
9 3470
"Jim" <an*******@discussions.microsoft.com> schrieb

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.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
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/
The Forecolor and Backcolor properties are still there in VB.NET.

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

.

Nov 20 '05 #3
<an*******@discussions.microsoft.com> schrieb
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)

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4
Jim
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/
Nov 20 '05 #5
"Jim" <an*******@discussions.microsoft.com> schrieb
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.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6
Jim
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/

Nov 20 '05 #7
"Jim" <an*******@discussions.microsoft.com> schrieb
Well, it's all about the *compact framework*!!
Yes, I know, but as I said I can't help you with the CF.
You are correct. It works fine for a standard desktop
app. Doesn't work for a CE.NET app! :(

Thanks MS!

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #8
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.
Nov 20 '05 #9
Cc
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

Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2678
by: Max Weebler | last post by:
Hi, I have a datagrid built that has an alternating item style that sets the backcolor and ForeColor of its rows. I have 4 template columns. One of them has a LinkButton embedded in it to...
1
4086
by: Firewalker | last post by:
I am attempting to change the backColor property on the previously instantiated buttons FROM a listbox_doubleClick event. I thought it would be something like this: If...
4
5082
by: Stephen | last post by:
greeting folks I would like to change the foreground color for a disabled textbox from the dimmed gray to something else that is easlier readable. I can change the background using the...
3
8968
by: Eric Moreau | last post by:
Hi I have a user that is visually impaired and who cannot read textboxes content when they are disabled. I have tried to inherits from the Textbox and overwrite the Paint method but I have...
4
1808
by: Bob | last post by:
Hi, When clicked into any cell of the table, i want to get the background color of it. I can get the forecolor but not the bakground color (gives an empty Alert, no error). I think i can't...
0
1256
by: Wolfgrin | last post by:
Hi, I have set up a report In Access 2003 where there are 2 check boxes I refer to to change the color of the Date of that record. That part is working. I also need to Change the color of the...
3
1531
by: ApexData | last post by:
I am using labels in the form header to sort the fields of a continuous form. When the user clicks on a label, the fore color becomes blue. When the user clicks on a different Label, I would like...
3
4507
by: Joseph Gruber | last post by:
Hi all -- I have two questions. First, I'm adding a control to my form at runtime and the control/form seems to ignore the anchor property of the runtime control. Any idea how I can get a...
17
10293
by: govolsbaby | last post by:
Is there a way to leave the button forecolor unchanged when it is disabled? I have multiple buttons on the form and depending on various user inputs, some will or will not be enabled but I'd...
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.