473,320 Members | 2,048 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,320 software developers and data experts.

How to retrieve the border colour of a TextBox?

Hi,

I'm writing my own control and I would like it to integrate nicely
into the rest of my application, which uses the standard controls
primarely. I therefore wanted my control to use the same border colour
as the rest of the controls, ex the TextBox control. After trying all
the colours in SystemColors, I was still unable to find the correct
colour. Then searched Google, and the only thing that came up was
this:

http://groups.google.com/group/micro...2eb0107f51e5df

Does that mean, that it is impossible to get the right colour? I could
of course do as suggested in the post (getting the RGB value and using
that), but it wouldn't work if my user used another Windows style.

Any suggestions?

Thanks in advance!

Dan

Mar 14 '07 #1
6 2568
VJ
The system set themes can read using Environment.GetEnvironmentVariable("");
I don't remember what's is the variable that is used to get the default
system color. this color or theme is used as border color for boxes..

HTH
VJ

"Dan Soendergaard" <da*****@gmail.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
Hi,

I'm writing my own control and I would like it to integrate nicely
into the rest of my application, which uses the standard controls
primarely. I therefore wanted my control to use the same border colour
as the rest of the controls, ex the TextBox control. After trying all
the colours in SystemColors, I was still unable to find the correct
colour. Then searched Google, and the only thing that came up was
this:

http://groups.google.com/group/micro...2eb0107f51e5df

Does that mean, that it is impossible to get the right colour? I could
of course do as suggested in the post (getting the RGB value and using
that), but it wouldn't work if my user used another Windows style.

Any suggestions?

Thanks in advance!

Dan

Mar 14 '07 #2
On Mar 14, 3:48 pm, "VJ" <nonewsaddr...@yahoo.comwrote:
The system set themes can read using Environment.GetEnvironmentVariable("");
I don't remember what's is the variable that is used to get the default
system color. this color or theme is used as border color for boxes..

HTH
VJ

"Dan Soendergaard" <dan1...@gmail.comwrote in message

news:11**********************@n59g2000hsh.googlegr oups.com...
Hi,
I'm writing my own control and I would like it to integrate nicely
into the rest of my application, which uses the standard controls
primarely. I therefore wanted my control to use the same border colour
as the rest of the controls, ex the TextBox control. After trying all
the colours in SystemColors, I was still unable to find the correct
colour. Then searched Google, and the only thing that came up was
this:
http://groups.google.com/group/micro...languages.csha...
Does that mean, that it is impossible to get the right colour? I could
of course do as suggested in the post (getting the RGB value and using
that), but it wouldn't work if my user used another Windows style.
Any suggestions?
Thanks in advance!
Dan
I just tried to use Environment.GetEnvironmentVariables() to get all
the variables, but none of them had anything to do with the Windows
Themes. Maybe it's a completely custom variable or something?

Mar 14 '07 #3
VJ
The other option would be to see if you anything in the Native API that you
can use..

are in 1.1 or 2.0 ?

VJ

"Dan Soendergaard" <da*****@gmail.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
On Mar 14, 3:48 pm, "VJ" <nonewsaddr...@yahoo.comwrote:
>The system set themes can read using
Environment.GetEnvironmentVariable("");
I don't remember what's is the variable that is used to get the default
system color. this color or theme is used as border color for boxes..

HTH
VJ

"Dan Soendergaard" <dan1...@gmail.comwrote in message

news:11**********************@n59g2000hsh.googleg roups.com...
Hi,
I'm writing my own control and I would like it to integrate nicely
into the rest of my application, which uses the standard controls
primarely. I therefore wanted my control to use the same border colour
as the rest of the controls, ex the TextBox control. After trying all
the colours in SystemColors, I was still unable to find the correct
colour. Then searched Google, and the only thing that came up was
this:
>http://groups.google.com/group/micro...languages.csha...
Does that mean, that it is impossible to get the right colour? I could
of course do as suggested in the post (getting the RGB value and using
that), but it wouldn't work if my user used another Windows style.
Any suggestions?
Thanks in advance!
Dan

I just tried to use Environment.GetEnvironmentVariables() to get all
the variables, but none of them had anything to do with the Windows
Themes. Maybe it's a completely custom variable or something?

Mar 14 '07 #4
On Mar 14, 7:08 pm, "VJ" <nonewsaddr...@yahoo.comwrote:
The other option would be to see if you anything in the Native API that you
can use..

are in 1.1 or 2.0 ?

VJ

"Dan Soendergaard" <dan1...@gmail.comwrote in message

news:11**********************@o5g2000hsb.googlegro ups.com...
On Mar 14, 3:48 pm, "VJ" <nonewsaddr...@yahoo.comwrote:
The system set themes can read using
Environment.GetEnvironmentVariable("");
I don't remember what's is the variable that is used to get the default
system color. this color or theme is used as border color for boxes..
HTH
VJ
"Dan Soendergaard" <dan1...@gmail.comwrote in message
>news:11**********************@n59g2000hsh.googleg roups.com...
Hi,
I'm writing my own control and I would like it to integrate nicely
into the rest of my application, which uses the standard controls
primarely. I therefore wanted my control to use the same border colour
as the rest of the controls, ex the TextBox control. After trying all
the colours in SystemColors, I was still unable to find the correct
colour. Then searched Google, and the only thing that came up was
this:
http://groups.google.com/group/micro...languages.csha...
Does that mean, that it is impossible to get the right colour? I could
of course do as suggested in the post (getting the RGB value and using
that), but it wouldn't work if my user used another Windows style.
Any suggestions?
Thanks in advance!
Dan
I just tried to use Environment.GetEnvironmentVariables() to get all
the variables, but none of them had anything to do with the Windows
Themes. Maybe it's a completely custom variable or something?
I'm using 2.0. Yes, P/Invoke is a possibility, but I have very little
experience with it. Could you give me some pointers to where to go? (I
have the Windows SDK, but it is huge!)

Dan

Mar 14 '07 #5
VJ
yes P/Invoke is a option.. I have some experience using it.. but again each
is different than the other. You can try codeproject.com or similar sites
for samples.. also
http://www.pinvoke.net/ is where I start mostly when I need something

VJ

"Dan Soendergaard" <da*****@gmail.comwrote in message
news:11**********************@l77g2000hsb.googlegr oups.com...
On Mar 14, 7:08 pm, "VJ" <nonewsaddr...@yahoo.comwrote:
>The other option would be to see if you anything in the Native API that
you
can use..

are in 1.1 or 2.0 ?

VJ

"Dan Soendergaard" <dan1...@gmail.comwrote in message

news:11**********************@o5g2000hsb.googlegr oups.com...
On Mar 14, 3:48 pm, "VJ" <nonewsaddr...@yahoo.comwrote:
The system set themes can read using
Environment.GetEnvironmentVariable("");
I don't remember what's is the variable that is used to get the
default
system color. this color or theme is used as border color for boxes..
>HTH
VJ
>"Dan Soendergaard" <dan1...@gmail.comwrote in message
>>news:11**********************@n59g2000hsh.google groups.com...
Hi,
I'm writing my own control and I would like it to integrate nicely
into the rest of my application, which uses the standard controls
primarely. I therefore wanted my control to use the same border
colour
as the rest of the controls, ex the TextBox control. After trying
all
the colours in SystemColors, I was still unable to find the correct
colour. Then searched Google, and the only thing that came up was
this:
>http://groups.google.com/group/micro...languages.csha...
Does that mean, that it is impossible to get the right colour? I
could
of course do as suggested in the post (getting the RGB value and
using
that), but it wouldn't work if my user used another Windows style.
Any suggestions?
Thanks in advance!
Dan
I just tried to use Environment.GetEnvironmentVariables() to get all
the variables, but none of them had anything to do with the Windows
Themes. Maybe it's a completely custom variable or something?

I'm using 2.0. Yes, P/Invoke is a possibility, but I have very little
experience with it. Could you give me some pointers to where to go? (I
have the Windows SDK, but it is huge!)

Dan

Mar 14 '07 #6
On Mar 14, 8:07 pm, "VJ" <nonewsaddr...@yahoo.comwrote:
yes P/Invoke is a option.. I have some experience using it.. but again each
is different than the other. You can try codeproject.com or similar sites
for samples.. alsohttp://www.pinvoke.net/ is where I start mostly when I need something

VJ

"Dan Soendergaard" <dan1...@gmail.comwrote in message

news:11**********************@l77g2000hsb.googlegr oups.com...
On Mar 14, 7:08 pm, "VJ" <nonewsaddr...@yahoo.comwrote:
The other option would be to see if you anything in the Native API that
you
can use..
are in 1.1 or 2.0 ?
VJ
"Dan Soendergaard" <dan1...@gmail.comwrote in message
>news:11**********************@o5g2000hsb.googlegr oups.com...
On Mar 14, 3:48 pm, "VJ" <nonewsaddr...@yahoo.comwrote:
The system set themes can read using
Environment.GetEnvironmentVariable("");
I don't remember what's is the variable that is used to get the
default
system color. this color or theme is used as border color for boxes..
HTH
VJ
"Dan Soendergaard" <dan1...@gmail.comwrote in message
>news:11**********************@n59g2000hsh.googleg roups.com...
Hi,
I'm writing my own control and I would like it to integrate nicely
into the rest of my application, which uses the standard controls
primarely. I therefore wanted my control to use the same border
colour
as the rest of the controls, ex the TextBox control. After trying
all
the colours in SystemColors, I was still unable to find the correct
colour. Then searched Google, and the only thing that came up was
this:
http://groups.google.com/group/micro...languages.csha...
Does that mean, that it is impossible to get the right colour? I
could
of course do as suggested in the post (getting the RGB value and
using
that), but it wouldn't work if my user used another Windows style.
Any suggestions?
Thanks in advance!
Dan
I just tried to use Environment.GetEnvironmentVariables() to get all
the variables, but none of them had anything to do with the Windows
Themes. Maybe it's a completely custom variable or something?
I'm using 2.0. Yes, P/Invoke is a possibility, but I have very little
experience with it. Could you give me some pointers to where to go? (I
have the Windows SDK, but it is huge!)
Dan
Thanks, I'll look into it when I get some time!

Mar 16 '07 #7

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

Similar topics

4
by: David Ehmer | last post by:
I have some buttons I'm working on at this address http://www.boatingaccessories.com.au/test3.htm In NS7, Mozilla and Opera, the borders don't render. IE6 displays as intended. Appreciate...
2
by: Olly | last post by:
I have been using border styles on form inputs and I have noticed that on Internet Explorer 5.2 Mac the border color always comes out as link-colour blue, no matter what color I specify. This also...
1
by: JD | last post by:
How do i get rid of the 1st column that appears in a datagrid? I do not want this? Also how do i change the colour of the background of a cell when the user selects it. i.e for the first coloumn...
1
by: ms | last post by:
Hi, I've been trying to find a way to change a cell's colour when clicking it. What I've found so far is to change the background colour by using: function whenClick(navElm) { var state1 =...
7
by: redneon | last post by:
Is it possible to change the border colour of a button whos FlatStyle is set to Flat? It's be nice to be able to change the width of the border too. Any ideas? Darrell
2
by: moondaddy | last post by:
I want to change the border of a asp.net textbox to thin-solid-blue but when I set the cssclass property to a class in the stylesheet, the border properties in the stylesheet don't have any effect...
7
by: garyusenet | last post by:
I'm using krypton toolkit which has allowed me to make a cool looking form. However, when I set my textbox to disabled it is 'greyed' out. The grey colour isn't in keeping with the office 2007...
1
by: Mark Rae | last post by:
Hi, Have been modifying a piece of JavaScript I found on the net which completely prevents the Google AutoFill Toolbar from doing its stuff... Got that working now but, while I was debugging it,...
23
by: cmcdermo | last post by:
I want to change the colour of a border around an image when a user clicks on the image. Not sure how to go about this, i have tried a few things but it doens't seem to work. here is my image....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.