Newbie Question


Author
Message
Ben Kim
Ben Kim
StrataFrame Novice (115 reputation)StrataFrame Novice (115 reputation)StrataFrame Novice (115 reputation)StrataFrame Novice (115 reputation)StrataFrame Novice (115 reputation)StrataFrame Novice (115 reputation)StrataFrame Novice (115 reputation)StrataFrame Novice (115 reputation)StrataFrame Novice (115 reputation)
Group: Forum Members
Posts: 99, Visits: 253
Hello all,

Sorry for the newbie question and I imagine the answer is no.  I have a method I want to run after the form is completely loaded.  What I mean by Loaded is all controls have been drawn and the form is waiting for user input.  I can see running this method in the background so perhaps a worker thread is appropriate here? 

My question is this:  Is there a standard form event I can use to call my method after the form has been completely drawn?  I have tried after InitializeComponents in the New event, Load, Activate, GainFocus (with a flag stating its the initial load), etc. and none of these events allow the form to completely draw prior to calling my method that takes between 5-10 seconds to run.

Ideas?

Ben

StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
You can create a System.Threading.Timer within the Load event and have it wait about 250ms before processing your callback.  Also, the callback will already happen on another thread (it doesn't invoke on the main thread), so there's no need to create another thread explicitly.  Or, you can put your code in the Shown() event... I believe that's the one that fires after the SetVisibleCore() has been called on the form to draw everything.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search