PDA

Click to See Complete Forum and Search --> : How doe I code a form to detect the user's window's (appearence "desktop Color"


Daniel_Christie
Nov 2nd, 2000, 11:21 AM
I have a form that has a label on it.
I need my form to properly determine the Window's apperence setting value of a user's "Desktop color" and set the label's background color to match that color.

I can code everything else, but what is the API coding for determining the user's desktop color value?

Orpheus
Nov 2nd, 2000, 11:25 AM
place the label onto the form and then in the properties window, set the .BackColor to "Desktop"

Daniel_Christie
Nov 2nd, 2000, 12:15 PM
So your saying I can -lblShout.BackColor=Desktop- and that will set the background color to any system's desktop color?

Geez, that was very simple, I must have been sleep that day of class. (*blush*).

Orpheus
Nov 2nd, 2000, 01:08 PM
No:

You set the property in the design view, properties window.

It would appear that this sets the color property to the current colour of the desktop on the machine upon which the form is developed - I would try it, then change the desktop colour and see if it updates the form correctly. If not, I will try to dig out the API for you.

Daniel_Christie
Nov 2nd, 2000, 01:13 PM
Orpheus,

I gotcha, thanks again.

Daniel_Christie
Nov 2nd, 2000, 01:28 PM
It sets the color to my (the designing system), desktop color.

Once it is compiled, it stays as my system's setting and does not take note of anyone else's system settings...

I think we're gonna have to call out the big "API" guns here :-)

Orpheus
Nov 3rd, 2000, 04:47 AM
Had more time this morning.

It would appear that if you place the line

Label1.BackColor = vbDesktop

within your form load event, the control's background colour will change to the desktop color on the machine.

Intrestingly, it also traps the SystemColorChange event and changes the background color mid flow if you change the background color using the display properties whilst the program is running.

Daniel_Christie
Nov 3rd, 2000, 06:52 AM
I am not at home at this time, but if that is true
then I am a very delighted coder, I appreciate all of your time and effort...

I hope my question didn't keep you up all last night, heh.