|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Form Load EventI have the following code for showing a form:
dim frm as new myForm frm.ShowDialog (The Form Load Event is fired then I hide the form using Me.Hide when the X in the UR corner is clicked). 'Do something in code frm.ShowDialog (The Form Load Event fires again) Shouldn't the Form Load event fire only once when the form is first shown and not again unless I do a form.close first? ...... -- Dennis in Houston
Show quote
Hide quote
"Dennis" <Den***@discussions.microsoft.com> schrieb: 'Load' will be raised prior to showing the form, so it can be raised more >I have the following code for showing a form: > > dim frm as new myForm > > frm.ShowDialog (The Form Load Event is fired then I hide the form using > Me.Hide when the X in the UR corner is clicked). > > 'Do something in code > > frm.ShowDialog (The Form Load Event fires again) > > Shouldn't the Form Load event fire only once when the form is first shown > and not again unless I do a form.close first? than once. If code should only be executed on time for each form instance, add the code in the form's constructor directly after the call to 'InitializeComponent'. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> If the load event is going to be fired each time I show the form, then what's
the difference between the Load Event and the Activated EVent...they both seem to fire whenever I show the form? Thanks for help Herfried! Show quoteHide quote "Herfried K. Wagner [MVP]" wrote: > "Dennis" <Den***@discussions.microsoft.com> schrieb: > >I have the following code for showing a form: > > > > dim frm as new myForm > > > > frm.ShowDialog (The Form Load Event is fired then I hide the form using > > Me.Hide when the X in the UR corner is clicked). > > > > 'Do something in code > > > > frm.ShowDialog (The Form Load Event fires again) > > > > Shouldn't the Form Load event fire only once when the form is first shown > > and not again unless I do a form.close first? > > 'Load' will be raised prior to showing the form, so it can be raised more > than once. If code should only be executed on time for each form instance, > add the code in the form's constructor directly after the call to > 'InitializeComponent'. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> > > "Dennis" <Den***@discussions.microsoft.com> schrieb: The 'Activated' event will fire too then the form looses focus and is > If the load event is going to be fired each time I show the form, then > what's > the difference between the Load Event and the Activated EVent...they both > seem to fire whenever I show the form? Thanks for help Herfried! reactivated later. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Loopy over loops
looking for CPU-specific developer's benchmarking From VB.NET to Delphi7 convert. How to Prevent Flicker when Updating ListView Form that slides up into view (MSN Style) e.Cancel = True in MDI Child Closing event List View question AddHandler RemoveHandler Question Listview with black box as cursor inheritance and shared |
|||||||||||||||||||||||