Solved

Event that occurs when a nonmodal form is completly loaded and shown

Posted on 2003-11-14
2
393 Views
Last Modified: 2010-04-16
Hi,

i need an event, that occurs when a nonmodal form is COMPLETLY loaded and shown to the user, that means that the user can use the form immediatly.
I set the Cursor to WAITCURSOR and create the form when the user hits a node on a treeview. Then, when the form is shown , i need an event thet resets the WaitCursor to Default. I need this,because i dont want that the user thinks he hasn't hit the node and repeats to click on it. The form uses database access and crystal reports so it takes a few seconds (especially on older pcs) until the form appears.
I tried quite all possible events of the form (Load, Activated, GotFocus...) but they all reset the Cursor to early (the form appeard not jet).

Thanks in advance for any help!

frave
0
Comment
Question by:frave
2 Comments
 
LVL 10

Expert Comment

by:ptmcomp
Comment Utility
I think you have to use the Application.Idle

Do something like this:

private EventHandler EventHandler formReadyHandler;
....
public void ShowAForm()
{
    formReadyHandler = new EventHandler(Form_Ready);
    Applicaton.Idle += formReadyHandler;
    AForm.Show();
}

private void Form_Ready(object sender, EventArgs e)
{
    Applicaton.Idle -= formReadyHandler;
    // form is ready
}
0
 
LVL 3

Accepted Solution

by:
Sijin earned 125 total points
Comment Utility
Form.Load is the last event to to be fired before the form is shown, why not set this.Cursor = Cursors.Default as the last line of this event?

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now