473,395 Members | 2,689 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,395 software developers and data experts.

Probably an intro question -> starting window over? calling form_load?

This may be something that is painfully easy and I'm just missing, or it
could be something that I should learn a bit more in order to do.

But, if I have a simple windows form application, with just one form with
basic buttons, labels, etc, [and a couple timer controls, which count down
the time they have to enter a string into a single line textbox].
At a point in this little app I want the user to be able to 'start over'.

I'm wondering two things:
1) Can I do this by somehow calling the original Form1_Load ?

2) Or, if this is generally frowned upon, should I simply go through
resetting everything and disregard the original Form1_Load [except for the
variables, properties, etc, that need to be set properly]?
I hope this makes sense... but my main question is whether #1 is something
that either can be done / is it something that is frowned upon being done.

I apologize for not being experienced enough to know, but hope that someone
has a moment to help me out.

Thanks
Matt
Jan 12 '06 #1
5 1113
matthewtec wrote:
This may be something that is painfully easy and I'm just missing, or it
could be something that I should learn a bit more in order to do.

But, if I have a simple windows form application, with just one form with
basic buttons, labels, etc, [and a couple timer controls, which count down
the time they have to enter a string into a single line textbox].
At a point in this little app I want the user to be able to 'start over'.

I'm wondering two things:
1) Can I do this by somehow calling the original Form1_Load ?

2) Or, if this is generally frowned upon, should I simply go through
resetting everything and disregard the original Form1_Load [except for the
variables, properties, etc, that need to be set properly]?
I hope this makes sense... but my main question is whether #1 is something
that either can be done / is it something that is frowned upon being done.

I apologize for not being experienced enough to know, but hope that someone
has a moment to help me out.

Thanks
Matt

Calling the original Form1_Load isn't the same as reloading the form--it
just contains code to fire in response to the form loading. What I
usually do in a situation like that is have a Sub that resets all the
controls and whatnot to their original state.

Alternatively (and I've never tried this, nor do I think it's an elegant
solution), is to ope a tiny second form with its opacity set to 0 and
set to not show in the task bar, and have the Form2_Load close the
original Form1, reopen it, then close itself).

Like I said, that solution isn't your best bet, but it's an option.
Jan 12 '06 #2
Matthewtec,

we don't know if you use version 2002/2003 or version 2005. However go to
the designer generated part. (For 2005 you have first to set the option show
all files in the solution explorer).

Than open the plus of that. You see there a sub InitializeComponent

After that you have done me.controlcollection.clear you can use this method.

I hope this helps,

Cor
Jan 12 '06 #3
Cor Ligthert [MVP] wrote:
Matthewtec,

we don't know if you use version 2002/2003 or version 2005. However go to
the designer generated part. (For 2005 you have first to set the option show
all files in the solution explorer).

Than open the plus of that. You see there a sub InitializeComponent

After that you have done me.controlcollection.clear you can use this method.

I hope this helps,

Cor

I think what he's trying to do isn't to completely clear all of the
contents of his form, but to reset them to the state they were in when
the form was first loaded.
Jan 12 '06 #4
Dave,

I think what he's trying to do isn't to completely clear all of the
contents of his form, but to reset them to the state they were in when the
form was first loaded.


That is what I describe. (However for describing there is a slight
difference between the versions)

Cor
Jan 12 '06 #5
Cor and Dave --

Thanks -- from your posts I am able to figure out what I should do... before
getting your posts, I wasn't sure if I was supposed to be calling the
initial Form_Load or resetting everything myself.

So, your posts helped very much... many thanks.

[Also... I'm not sure if this is the information you're looking for, but in
Help/About, I have:
Microsoft Development Environment 2003
Microsoft .NET Framework 1.1
]

Thanks.
matt

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:OH**************@TK2MSFTNGP09.phx.gbl...
Dave,

I think what he's trying to do isn't to completely clear all of the
contents of his form, but to reset them to the state they were in when
the form was first loaded.


That is what I describe. (However for describing there is a slight
difference between the versions)

Cor


Jan 12 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Kamus of Kadizhar | last post by:
I'm looking for a good intro to python book. I'm very familiar with programming, but know nothing of OOP or systems (OS type) programming. All of my programming experience is in number crunching...
3
by: Brett C. | last post by:
Anthony Baxter, our ever-diligent release manager, mentioned this past week that Python 2.3.5 will most likely come to fruition some time in January (this is not guaranteed date). This means that...
13
by: Alf P. Steinbach | last post by:
The third part of my attempted Correct C++ tutorial is now available, although for now only in Word format (use free Open Office if no Word), and also, it's not yet been extensively reviewed -- ...
2
by: Chad | last post by:
I'm in an intro to VB.net class. I'm haveing trouble with this assignment, if anyone could help me please let me know. thanks! Coding Assignment 7-Chapter 8 OOP-CSCI-171 Intro to VB.NET ...
3
by: Guy Middleton | last post by:
A friend want to learn C, and is already an experienced programmer -- she knows VB and Java, and some application-specific HLLs (e.g. ToolBook). Could somebody recommend an intro C text I could...
7
by: TechBookReport | last post by:
TechBookReport have just published a review of 'C Programming In Easy Steps', if you're a C beginner looking for an intro book (or an ex-C developer looking for a quick refresh), ready why this is...
1
by: Tara | last post by:
intro about Asp ..help -------------------------------------------------------------------------------- HI All , i am not into development ...i am into testing actually ... So just for...
6
by: shapper | last post by:
Hello, When styling a DIV as follows: <div id="intro" class="Intro">Some intro text</div> Should I use a class: ..Intro {...} Or:
1
by: annabel59 | last post by:
I made a Flash intro for my website but when I open it in IE7 it gives error : expected object. It works fine in Mozilla. This is the code of the index.html file : <html> <head>...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.