By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,361 Members | 1,352 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,361 IT Pros & Developers. It's quick & easy.

"Resetting" a form

P: n/a
I have a CSV processing program that instantiates Excel and performs various
operations. I want the ability to reset the main form for running another
data set with defaults selected. Right now I am one-by-one restoring every
control to its initial state, but it occurred to me that if I could unload
and reload the main form (from another module) that I could quickly and
cleanly accomplish the same thing... right? But how would I do this in .Net?

Randall Arnold
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
Randall Arnold wrote:
I have a CSV processing program that instantiates Excel and performs various
operations. I want the ability to reset the main form for running another
data set with defaults selected. Right now I am one-by-one restoring every
control to its initial state, but it occurred to me that if I could unload
and reload the main form (from another module) that I could quickly and
cleanly accomplish the same thing... right? But how would I do this in .Net?

Randall Arnold

Create a module with a sub mail in it. In the module so something like...
sub main()
dim F as new form
application.run(F)
end sub

Then make the module your startup object and you are good to go.

Chris
Nov 21 '05 #2

P: n/a
That's actually very similar to what I wound up doing, which is:

Private Sub ResetAll_button_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ResetAll_button.Click
Call Module1.Reset()
Me.Close()
End Sub

Module Module1
Public Sub Reset()
Dim Form1 As New Form1
Form1.Show()
End Sub
End Module

Works like a charm! But thanks for responding (I may try yours to see if
it's better).

Randall

"Chris" wrote:
Randall Arnold wrote:
I have a CSV processing program that instantiates Excel and performs various
operations. I want the ability to reset the main form for running another
data set with defaults selected. Right now I am one-by-one restoring every
control to its initial state, but it occurred to me that if I could unload
and reload the main form (from another module) that I could quickly and
cleanly accomplish the same thing... right? But how would I do this in .Net?

Randall Arnold

Create a module with a sub mail in it. In the module so something like...
sub main()
dim F as new form
application.run(F)
end sub

Then make the module your startup object and you are good to go.

Chris

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.