Results 1 to 7 of 7

Thread: Remembering custom colors with common dialog?

  1. #1

    Thread Starter
    Hyperactive Member brenaaro's Avatar
    Join Date
    Sep 2001
    Location
    Montreal, Canada
    Posts
    391

    Question Remembering custom colors with common dialog?

    How can I get the Common Dialog control to remember custom colors that my user has defined?
    And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.

  2. #2
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819
    After the user selects a color save it to the registry. Then read the registry when the commondialog is loaded next time:

    VB Code:
    1. Sub GetColor
    2. Dim iColor As Long
    3.  
    4. iColor = GetSetting(App.Title,"Colors","Hair color",vbBlack)
    5.  
    6. CommonDialog.Color = iColor
    7. CommonDialog.ShowColor
    8.  
    9. SaveSetting (App.Title, "Colors", "Hair color", CommonDialog.Color

  3. #3
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    You could achieve the same with a textfile...

    Question: If using Registry, and not Admin on system in say NT or Win2000, will application crap out on you?
    Last edited by James Stanich; Jun 25th, 2002 at 08:14 PM.
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  4. #4
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819

    Re: Well

    Originally posted by James Stanich

    Question: If using Registry, and not Admin on system in say NT or Win2000, will application crap out on you?
    No. All my apps use the registry and many are on NT and 2000 being used by people without admin privileges. It's never been a problem.

  5. #5
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Thats good to know. Someone else said it wouldn't make a difference, but it's always good to get a second opinion.
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  6. #6
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125

    Re: Well

    Originally posted by James Stanich
    You could achieve the same with a textfile...

    Question: If using Registry, and not Admin on system in say NT or Win2000, will application crap out on you?
    It will only crap out on you if the admin specifically set it to not allow any registry access. My teacher did that last semester, but then none of the regular programs that we used would work because they couldn't write to the registry. He learned that he was just gonna have to let us have access to the registry and just disable regedit.
    <removed by admin>

  7. #7

    Thread Starter
    Hyperactive Member brenaaro's Avatar
    Join Date
    Sep 2001
    Location
    Montreal, Canada
    Posts
    391

    Unhappy

    Okay, I know how to save which color my user has chosen (I do use registry), but the thing is he (my boss btw ) wants to be able to define a set of custom colors in the dialogue, and then the next time he loads the program, have all of his custom colors there. Is there a way to do it by API or something?
    And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.

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