473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

"Resetting" a form

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
2 1206
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Konstantin Zakharenko | last post by:
Hello, Our QA team have running a lot of test scripts (for automated regression testing), they run them on the different databases (Oracle/MS SQL). Several of those tests are dependent on the...
10
by: comp.lang.php | last post by:
echo mime_content_type('/var/www/html/video/small.mov'); // 1.5mb Quicktime video returns "video/quicktime" echo mime_content_type('/var/www/html/video/huge.mov'); // 10.5mb Quicktime video...
2
by: Praveen | last post by:
In the ISPF editor I am using, for a particullar PO Dataset I am getting the result of FIND statement narrowed down to the colums 48-56. i.e. if I give "FIND 'TO' ALL", the result I am getting as...
2
by: Jerry Boone | last post by:
Funny thing happened today... I thought I was going to be smart and customize my menu's by dragging the Refresh option from the Records menu onto the toolbar in Access 2000. When doing so, I...
2
by: Patrick Spence | last post by:
(sorry 'bout the multipost) VS.NET 2003 v 7.1.3088 ..NET Framework v1.1.4322 XP Pro IIS 5.0 When I try to create a ASP.NET application, I get the following error... The Web server...
1
by: Arjun | last post by:
Hi, I wasn't sure quite what to title this, so I just chose something that sounded reasonably correct. If I butcher and/or misuse any terms in this post, then I apologize, please correct me. ...
0
by: rokuingh | last post by:
ok, so i've been working on this one for quite a while, and the code is very big so i'm just going to give the relevant parts. this is a program that builds polymers (chemical structures of repeated...
15
by: rover8898 | last post by:
Hello all, I used setjmp() in a recent of program of mine (it is not completed, so I have not the chance to test it out yet). I am not very profocient in C coding as are some of my co-workers....
3
by: Jack Brown | last post by:
Hi there, Has anyone noticed that the "Form.CancelButton" property occasionaly resets itself to "(none)" in the form's property window for no apparent reason (at deisng time using VS 2005). Has...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.