Solved

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

Posted on 2003-11-14
2
397 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to get the web content with different encodings 2 45
Close form "before" open 3 40
Hey Audio! 3 29
HttpPostedFile 1 26
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

773 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