How can I get the Common Dialog control to remember custom colors that my user has defined?
Printable View
How can I get the Common Dialog control to remember custom colors that my user has defined?
After the user selects a color save it to the registry. Then read the registry when the commondialog is loaded next time:
VB Code:
Sub GetColor Dim iColor As Long iColor = GetSetting(App.Title,"Colors","Hair color",vbBlack) CommonDialog.Color = iColor CommonDialog.ShowColor SaveSetting (App.Title, "Colors", "Hair color", CommonDialog.Color
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?
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.Quote:
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?
Thats good to know. Someone else said it wouldn't make a difference, but it's always good to get a second opinion. ;)
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.Quote:
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?
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?