labels - forecolor and backcolor

spyter

New member
Joined
Dec 30, 2008
Messages
4
Programming Experience
Beginner
I believe this is the right section of the forum for this post, please excuse me if its not. I made a small application and I have a picture in the background of the form (to add dimension and better its appearance). The labels and buttons I have on top of the image have a small white box around them inwhich needs to be transparent. I tried to set on formload to

me.labelname.backcolor = color.transparent
but it does not do anything.

Also, I am trying to change the forecolor of a label by using me.labelname.forecolor = color.cyan and when this code runs, ALL the labels forecolors are being changed. im am using vb.net 2008 (if that matters). the only way i can change the labels forecolor in the code is to specify every labels forecolor individually each time.. (that is a pain/lot of code)


-------------------------
any input on these two issues would be greatly appreciated. I have tried anything and everything i could think of / google and i cant get it to work.

thanks in advance!!!!
 
Hello.

That's how it is. But you could inherit the Label class and define your own default settings in the Constructor.

Maybe there's something overlapping since the Label does support Transparency, try setting it using the Property Editor, or set it in the Shown Event.

Bobby
 
i dont know about the transparent color problem but if u want change then
forecolor of number of lable then this code slould help u. :)
For Each myControl As Control In <Container> eg. GroupBox1.Controls
If TypeOf myControl Is System.Windows.Forms.Label Then
myControl.ForeColor = Color.Gray
End If
Next myControl
 
Back
Top