Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Event after form is fully loaded?

Tags:

I want to do an event after Form_Load event.

What is the event of "form fully loaded"?

like image 292
tst Avatar asked Aug 27 '12 16:08

tst


People also ask

Which event gets triggered when form gets loaded on screen?

The load event is called once all the components of the form are loaded. If you redisplay the form, its components load again and therefore the Load event is triggered once more.

What is form load event?

The Form Load Event in VB . NET. An important event you'll want to write code for is the Form Load event. You might want to, for example, set the Enabled property of a control to False when a form loads. Or maybe blank out an item on your menu.

Which event is executed first for form control?

The Form and Control classes expose a set of events related to application startup and shutdown. When a Windows Forms application starts, the startup events of the main form are raised in the following order: Control. HandleCreated.

How do you call a load event in C#?

You have to call Form_load. Form_Load(this, null);


2 Answers

You are looking for the event Form.Shown().

See the references on MSDN

This is the last event in the event chain when you open a form as documented here The Form 'Load' event is raised before the form is visible, the form 'Shown' event is raised when the form is visible. (and all controls too)

Also, remember to avoid calls to MessageBox inside the form 'Load' event, this disrupts the normal flow of events.

like image 112
Steve Avatar answered Sep 19 '22 18:09

Steve


You likely want to use Form.Shown. This is the last event raised during the initial display of the form.

For details, see Order of Events in Windows Forms. It details which events are raised, and in which order.

like image 45
Reed Copsey Avatar answered Sep 18 '22 18:09

Reed Copsey