C# – How to know when a form is shown

ccompact-frameworkeventswinforms

I'm developing a Windows Mobile 5.0 or above with .Net Compact Framework 2.0 SP2 and C#.

I have a WinForm that only has a Custom Control. I want to call a method of that custom control when the form has finished loading and display the control.

Now I using Activated Event, but these event is thrown everytime when I close a messagebox.

Is there an event thrown in that moment?

Thank you.

Best Answer

Simply use the activate event and have a boolean in your form that is set to true when you have called the method on your custom control. When the form's activated event is triggered again, you just make a check on this boolean.