?
Solved

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

Posted on 2003-11-14
2
Medium Priority
?
403 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 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