Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / October 2007

Tip: Looking for answers? Try searching our database.

Refresh forms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MikeS - 30 Oct 2007 17:27 GMT
I have a question concerning closing and re-opening forms.  When I open a
form and make changes or enter some data, then close the form and re-open it,
the same data/changes are still there.  How can I re-open the form as though
it is the first time I have opened it?  In other words, I want to re-open the
form as though it is a new instance of the form with all fields and variables
empty.

Can someone tell me how to do this?

TIA

Mike S
Terry - 30 Oct 2007 18:43 GMT
Sounds like you are using the default instance of the form.  So either create
your own instance each time you need the form or add a public DoRefresh
method to your form (which would reset the form to its initial values) and
call it right before you use (show) the form each time.
Signature

Terry

> I have a question concerning closing and re-opening forms.  When I open a
> form and make changes or enter some data, then close the form and re-open it,
[quoted text clipped - 8 lines]
>
> Mike S
Miro - 30 Oct 2007 21:22 GMT
> I have a question concerning closing and re-opening forms.  When I open a
> form and make changes or enter some data, then close the form and re-open it,
[quoted text clipped - 8 lines]
>
> Mike S

Check to see where you form is being dim'd
it might look something like this:
DIM fbla AS Form

you most likley are missing the "NEW" parameter.

DIM fbla AS NEW Form
Eternal Snow - 31 Oct 2007 03:00 GMT
If the values are global setting, you wanna save those for next running,
please bind the value to ApplicationSettings. All settings will be saved to
and reloaded from your app.config automatically.

If you just want to save those in one instance, there are 2 ways to deal
with it.
1 Create a module or static class and define all value you need with saving
all of that while closing that form. When re-open it, just reload that from
those value by your code.
2 Create a module or static class to hold the define of that form (Dim xxx
As Form1). Use xxx.Hide to hide your form instead of closing it. And Use
xxx.Show to reopen it.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.