Solved

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

Posted on 2003-11-14
2
395 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
ID: 9749145
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
ID: 9753587
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

15 Experts available now in Live!

Get 1:1 Help Now