473,396 Members | 1,982 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 get color of default TextBox.

When you create some controls such as a TextBox or a TreeView, they are
created with a bluish border around them (if u are using the default
blue windows XP style). I want to create a Label, and draw a border
around the label with the same border shown around the TextBox. How
can I do this?

So far I am drawing the border in the Paint method for the label using
ControlPaint.DrawBorder. However, I do not know how to get the exact
color that the TextBox uses for its border. I have enumerated through
all the System.Drawing.SystemColors, and it is not there?

Thanks for your help.

Mar 5 '06 #1
1 2519
Hi,

I think you should be able to find that color in the SystemColors
enumeration. Wonder why you're not able to find it...

Colors for a dark border usually are "ControlDark" or
"ControlDarkDark". For the "lighter" side of the border, they usually
are White or "ControlLight". I never use the Windows XP style (I prefer
Classic style), so can't say offhand.

Other ideas that come in my mind are :

1. Check the settings in the Display properties dialog box of Win XP.
You might find the color there.
2. You might try a Color Picker tool, and "pick" the color to determine
it's RGB values. Then use that color.

HTH,

Regards,

Cerebrus.

Mar 5 '06 #2

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

Similar topics

0
by: Agnes | last post by:
I had created a textbox usercontrol , My aim is "once the textbox got focus, its backcolor become lightgray", lost focus will change back to default.Please be kind to help. Private Sub...
1
by: John | last post by:
Hi, When a textbox gets focus in WinForm, the text inside the textbox is highlighted with default color. How can I get the value of the default highlight color like the following? Dim...
11
by: dgk | last post by:
Is there a way to change the foreground or background color of a single cell in an unbound datagridview?
2
by: rn5a | last post by:
During registration, users have to provide their date of birth. For the date & month part, there are 2 dropdown lists & for the year, there's a textbox. These 3 fields are finally merged together...
0
by: hanusoft | last post by:
This is an example of editing in DataGrid and Default Paging http://www.hanusoftware.com Html Design Code : - <asp:DataGrid id="DataGrid1" DataKeyField="id" runat="server" Height="224px"...
1
by: kcddoorman | last post by:
I have searched all over the internets for a solution to this problem and there are many ways to work around it but I'm wondering if there is a more simple solution. I have asp.net 2.0 working with...
3
by: Rex | last post by:
Hi - Is there any way to set default Properties - so that when I add a new textbox to a form - that that control wil start out using Arial 10 (for instance)? Thanks! Rex
5
by: nzkks | last post by:
Hi I am using these: ASP.Net 2.0, VB.Net, Visual Studio 2005, SQL Server 2005, Formview controls In a ASP.Net form I have 20 textboxes and 20 dropdownlists(ddl). All ddl(s) are databound and get...
4
by: aeris | last post by:
Hello! I'm using C# to doing my window application. May I ask, how to write text on textbox after the default text is clear? I have setted the default text in textbox, when a user click on it,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.