Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Triggering an event after a Winform layout is complete

I am working on a C# WinForm application.

I want to trigger some processing once the form has been "shown" and the layout of the form is complete.

I am using the "_Shown" event, but this seems to trigger before the layout of the form has completed. Is there event I can use that fires once the layout is complete?

like image 227
BENBUN Coder Avatar asked Jan 05 '10 10:01

BENBUN Coder


2 Answers

I don't see an event after Shown you can use for this purpose. Could you not use a timer to delay your processing in the Shown event?

like image 191
Tony The Lion Avatar answered Nov 15 '22 15:11

Tony The Lion


The best solution is the Shown() event: http://msdn.microsoft.com/en-us/library/system.windows.forms.form.shown.aspx

"The Shown event is only raised the first time a form is displayed; subsequently minimizing, maximizing, restoring, hiding, showing, or invalidating and repainting will not raise this event."

like image 44
JS5 Avatar answered Nov 15 '22 15:11

JS5