calling methods from form_load

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.
 
L

Leon

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
 
R

refl

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.
 
J

Joe Cool

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.
 
R

refl

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 ?
 
B

Ben Voigt [C++ MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top