Results 1 to 8 of 8

Thread: How doe I code a form to detect the user's window's (appearence "desktop Color"

  1. #1

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245
    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?
    I appreciate all of your time and effort,
    Daniel Christie
    VB 5 and 6 Enterprise Editions,
    Html, Java scipt, Vb script,
    & etc...
    http://www.qwcd.com

  2. #2
    Lively Member
    Join Date
    Oct 2000
    Location
    Leicestershire; ENGLAND
    Posts
    71
    place the label onto the form and then in the properties window, set the .BackColor to "Desktop"

  3. #3

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245

    Orpheus

    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*).
    I appreciate all of your time and effort,
    Daniel Christie
    VB 5 and 6 Enterprise Editions,
    Html, Java scipt, Vb script,
    & etc...
    http://www.qwcd.com

  4. #4
    Lively Member
    Join Date
    Oct 2000
    Location
    Leicestershire; ENGLAND
    Posts
    71
    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.


  5. #5

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245

    Orpheus...

    Orpheus,

    I gotcha, thanks again.
    I appreciate all of your time and effort,
    Daniel Christie
    VB 5 and 6 Enterprise Editions,
    Html, Java scipt, Vb script,
    & etc...
    http://www.qwcd.com

  6. #6

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245

    Orpheus, it sets the color once...

    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 :-)
    I appreciate all of your time and effort,
    Daniel Christie
    VB 5 and 6 Enterprise Editions,
    Html, Java scipt, Vb script,
    & etc...
    http://www.qwcd.com

  7. #7
    Lively Member
    Join Date
    Oct 2000
    Location
    Leicestershire; ENGLAND
    Posts
    71
    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.

  8. #8

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245

    Thank you..

    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.
    I appreciate all of your time and effort,
    Daniel Christie
    VB 5 and 6 Enterprise Editions,
    Html, Java scipt, Vb script,
    & etc...
    http://www.qwcd.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width