tags:

views:

30

answers:

1

I get a small lag at the controls I'm using when I start up my app. Can I show the main form after the controls are drawn?

+1  A: 

Try subscribing to the Application.Idle event inside your form's load method, and unsubscribing from it once invoked. Like this:

public Form()
{
    InitializeComponent();
}

private void Form_Load(object sender, EventArgs e)
{
    Application.Idle += new EventHandler(Application_Idle);
    // any loading prep code here
}

private void Application_Idle(object sender, EventArgs e)
{
    Application.Idle -= new EventHandler(Application_Idle);
    // additional code here, which is executed *after* controls are visible and loaded
}
JYelton