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 5 1127
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.
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 InitializeCompo nent
After that you have done me.controlcolle ction.clear you can use this method.
I hope this helps,
Cor
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 InitializeCompo nent
After that you have done me.controlcolle ction.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.
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
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******** ******@TK2MSFTN GP09.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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 and generic
graphics engines (read: gobs and gobs of matrix manipulations and
super-efficient sorts), all of it in C.
I've written exactly one program in Python.
So, I need something that covers the finer points of Python - difference...
|
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 in order to have enough time to
proper evaluate new patches and bugs they must be reported **now**! A one
month lead time is necessary to properly look at, test, and commit patches, let
alone coming up with solutions to any reported bugs.
...
|
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 -- comments welcome!
"Intro to loops"
<url: http://home.no.net/dubjai/win32cpptut/w32cpptut_01_03.doc>
As before I expect that here's mental food and technical points that
we can strongly disagree about, for both newbie and the experienced.
|
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
1. Create a Windows application that models a carton of eggs:
Define a public class and call it cEggCarton to model the egg carton.
Declare a module-scope object variable of type cEggCarton. Since we
want the object to persist throughout the life...
|
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 throw at her?
The learning curve in K&R is a bit too steep, but I'm not looking for "C for
Dummies" here.
| |
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 a book to
consider. Read the review here: http://www.techbookreport.com
|
by: Tara |
last post by:
intro about Asp ..help
--------------------------------------------------------------------------------
HI All ,
i am not into development ...i am into testing actually ...
So just for interest , i have gone through VB.NET and kind of comfortable with it
Now i want to start with Asp.net ..so refered this site to download asp.net
http://www.asp.net/downloads/essential.aspx?tabid=62
it says there
|
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:
|
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>
<title>ONDERWEG</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<meta name="description" content="Nederlandstalige website voor alleenstaanden. Activiteiten, dinners en parties voor alleenstaanden.">
<meta name="keywords"...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |