Macaco Posted January 22, 2005 Posted January 22, 2005 Hello, I need to find an eventHandler to call my function when the form and all its components are just loaded and showed. I looked at MSDN but I don't find anyone, it must be one! Help needed, thanks! Quote
Administrators PlausiblyDamp Posted January 22, 2005 Administrators Posted January 22, 2005 You could just use the Visiblechanged event - the first time the visibility changes will be when the form is first displayed. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Macaco Posted January 23, 2005 Author Posted January 23, 2005 I thied to use Visiblechanged event (with the form and woth a component inside the form) calling a function with a simple MessageBox:Show, and it shows it before the form is shown... and Visiblechanged event is the last thing I define... :( Quote
Macaco Posted January 23, 2005 Author Posted January 23, 2005 Well, I solved it, it's not a nice way but It works fine!!!!!!!!, I just wanted to call the Loop function once all is loaded, so... because of I have a panel inside the form I call my loop function when the panel first paint handler calls its function: with first_time boolean variable I will control that I will only be done once. Void panel_x_Paint(System::Object * sender, System::Windows::Forms::PaintEventArgs * e) { if (first_time) { first_time = false; LoopFunction(); } } simple and effective. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.