473,396 Members | 1,768 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to Change a Label's BackColor Property

Greetings,

I have a very "novice" question to ask, so hopefully it will be easy.
At any rate, I have a label on a Windows form called "label1". I simply
want to change the "backcolor" property to a different color (e.g.,
"blue"), but I haven't figured out how to do it. I want to do this when
the user clicks a button. Any ideas?

Thanks in advance!
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
3 18867
All you do is

label1.BackColor = Color.Aqua

Where label1 is the name of the label you want to change. Using Color
you could change it to any color you want.

Nov 17 '05 #2
On the form where these two controls are, double click the button that
you want to use to change the label's color. This will bring you to the
button's click event. In the braces for this routine, put the
following:

this.label1.BackColor = Color.Blue;

Once you build and run the app, clicking on the button thould set the
BackColor of the label blue.

Nov 17 '05 #3
Thank you both. I greatly appreciate it!

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #4

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

Similar topics

0
by: Bennett Haselton | last post by:
I've created a Web application project called WebApplication1. When I go into the properties dialog for the project, under Common Properties->Web Settings it lists "Web Server Information",...
2
by: Sjaakie Helderhorst | last post by:
Hi there, I created my own user control (myControl) containing: myCaption - docked top myGrid - docked.fill (datasource: myDataset) myPanel - docked bottom This control is added to the form:...
6
by: Roger Ries via DotNetMonster.com | last post by:
I'm trying to change the text in a label from another form. lblInfo.Text = "ABC" Works for the form your currently in but how the heck do you change that label information from another form. ...
1
by: Dean Slindee | last post by:
The code below runs in the form_paint event but changes nothing, anyone got a better idea or why this code is not effective? Imports System.Drawing.Drawing2D Dim ctl As Control Dim str As...
3
by: david | last post by:
I have written JavaScript and try to change the radio button property (disenable other radio buttons) once click on it. But it does not work. For example, I have radio buttons A, B, and C. A and B...
0
by: Carlos Barini | last post by:
I need to change the "Column.BackColor" when the user clicks the ColumnHeader. How can I do that? Tks. Carlos Barini. Brazil.
1
by: kostareject | last post by:
Hello! Can anyone tell me how can I printi label/textbox Text property in MDI Child by clicking MDI Parent print button in C#! I have MDI Chil form with several labels and textboxes, and I want...
0
by: kostareject | last post by:
Hello! Can anyone tell me how can I printi label/textbox Text property in MDI Child by clicking MDI Parent print button in C#! I have MDI Chil form with several labels and textboxes, and I want...
5
by: yappy77 | last post by:
I am trying to change the label color of a checkbox on a subform if it is checked. The code I have so far is: Private Sub Emergency_Contact_Click() If Me.Emergency Contact = True Then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.