当我启动应用程序时,我正在使用的控件有一个小的延迟。我可以在绘制控件后显示主要表单吗?
答案 0 :(得分:1)
尝试订阅表单加载方法中的Application.Idle
事件,并在调用后取消订阅。像这样:
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
}