|
-
June 18th, 2001, 02:55 PM
#1
Refresh
how do you clear all the user made changes on a form. Like when the user checks a check box the next time they get that form that checkbox shouldn't still be checked. I've tried Form2.refresh but that doesn't do anything
--Ant
--------------------------------------------------
check out my newest freeware
E-mail me at: [email protected]
for the address
-
June 18th, 2001, 03:03 PM
#2
Re: Refresh
Are you using Form1.Show to display your form and Hide to make it disappear? The Show method automatically invokes the Load method/event, the Hide method does not invoke the Unload method/event. Try using Unload to make your window go away, that way when it is displayed again it is re-loaded into memory and (i think...) should use its default settings.
-
June 19th, 2001, 10:59 AM
#3
Re: unloading slow down
Another way is to write a sub to reset your fields (it should be quicker than unloading and reloading the form):
ie:
inside a form
public sub resetMe()
'you may cycle throughout all controls
'with
'dim fMe as form
'dim ctl as control
'set fMe = thisformname
'for each ctl in fMe
'if typeOf ctl is checkbox then
'ctl.checked = false
'elseif
'...
'else
'...
'end if
'next ctl
'Or you may want to use specific code:
Check1.Value = false
Text1.Text = ""
'...
end sub
To call this "strange" sub, you type the name of form, type a point and...look: it is a method of the form, now!
ie:
Form1.resetMe
'or
with Form1
.resetMe
end with
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
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
|