Windows Develop Bookmark and Share   
 index > Windows Forms General > Get the TextBox Border Color
 

Get the TextBox Border Color

Hi,

I'm developing a custom control, whose background I wish to look like the TextBox control--white background, light blue border. I can override the WndProc function and set the border color to whatever I want. The problem I'm having is picking the right shade of light blue, so that the border looks just like a TextBox border. The closest match I could find was Color.SteelBlue. Does anyone know what the RGB values are for the default TextBox border color?

Thanks!
Adam Cataldo  Wednesday, April 02, 2008 8:46 PM

Here's a really great free tool for getting colors from anything you want. I use it all the time.

http://www.iconico.com/colorpic/

I'm not sure if the textbox border is something that changes depending on the current theme, but on my machine running the XP Blue theme the RGB color is 127,157,185.

If you want to get really complex, here is a good source for designing with windows themes: http://www.codeproject.com/KB/miscctrl/ThemedExplorerControls.aspx

Micah Martin  Wednesday, April 02, 2008 9:04 PM

Here's a really great free tool for getting colors from anything you want. I use it all the time.

http://www.iconico.com/colorpic/

I'm not sure if the textbox border is something that changes depending on the current theme, but on my machine running the XP Blue theme the RGB color is 127,157,185.

If you want to get really complex, here is a good source for designing with windows themes: http://www.codeproject.com/KB/miscctrl/ThemedExplorerControls.aspx

Micah Martin  Wednesday, April 02, 2008 9:04 PM
Thanks! That did the trick.
Adam Cataldo  Wednesday, April 02, 2008 10:42 PM

You can use google to search for other answers

Custom Search

More Threads

• message queueing just within the application
• NotifyIcon windows handle
• How do I convert a foreach loop into a for loop?
• Paint order of child controls
• Control similar to the Visual Studio Properties pane
• Progress execution when SQL running
• "Component Class" or "class"
• TypeInitializationException
• Event "Bubbling" In Windows Forms
• Using an embedded image for a button's background image