calling methods from form_load

  • Thread starter Thread starter refl
  • Start date Start date
R

refl

in winforms, c# we need to do two things...

Open a win form and within that form load event
convert data showing a processing message.

what would be the code sequence ?

Note...when calling the event, the form is not loaded/displayed yet.
I was looking for the next event after form was loaded (form activate is
called more that once in some situations e.g get focus,maximizeing it)

thanks.
 
in winforms, c# we need to do two things...

Open a win form and within that form load event
convert data showing a processing message.

what would be the code sequence ?

Note...when calling the event, the form is not loaded/displayed yet.
I was looking for the next event after form was loaded (form activate is
called more that once in some situations e.g get focus,maximizeing it)

thanks.

Create a boolean "switch" like bool IsLoading
in activate --> !IsLoading --> change isloading and do your thing
 
thanks Leon, that's what I've done,

is there any other event that is called once besides activate?

any other idea. Activate is called many times once the screen gains focus.
 
thanks Leon, that's what I've done,

is there any other event that is called once besides activate?

any other idea. Activate is called many times once the screen gains focus..

Form_Shown is raised after Form_Load.
 
Bingo!
thanks Joe, weird name "Shown" if we think many events are named as sequence
so I was looking Form_loaded or so,

do you have any URL where to find the calling sequence of events ?
 
refl said:
Bingo!
thanks Joe, weird name "Shown" if we think many events are named as
sequence
so I was looking Form_loaded or so,

do you have any URL where to find the calling sequence of events ?

That would be hard, because if you set Visible inside the Load event, then
the Shown event will be fired before Load is finished processing.
 
Back
Top