I get a small lag at the 开发者_JAVA技巧controls I'm using when I start up my app. Can I show the main form after the controls are drawn?
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
}
精彩评论