|
-
Apr 21st, 2000, 01:31 AM
#1
Can someone explain to me (in-depth), how to save settings like the backcolor and forecolor of a picture box.
-
Apr 21st, 2000, 01:44 AM
#2
Hyperactive Member
You can save setting by using Savesetting function.
savesetting app.path,"Settings","backcolor",form1.backcolor
in this example setting is a registry section and backcolor is the registry key and form1.backcolor is the setting you want to save.
To get the setting back from the registry:
private sub form1_load()
on error resume next
dim Color
color = getsetting(app.path,"settings","backcolor",vbblack)
me.backcolor = color
end sub
in this example you have to give the same address as you gave the savesetting so the program can find the correct value. Then the program will store the value into color variable. And then assign the color variable value to the form backcolor.
What is the purpose of (On error resume next)?
well first you start the program you havn't saved anything in the registry therefore program can not return any value and you will get an error message, so you put the on error resume next on top to avoid this.
-
Apr 21st, 2000, 01:57 AM
#3
I Tried...
I tried that and it saves but not the colors i told it to save and the things i dont want to change color, change color. What now?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|