[英]C# form upon activating when in minimized state shows incomplete form for few seconds
We have ac# form UI issue, when it is minimized state. 当它处于最小化状态时,我们会遇到ac#form UI问题。 There are few controls inside the form and the app is brought to normal state from minimized state from a different form - during this transition phase, the UI appears incomplete
表单内的控件很少,并且应用程序从其他表单的最小化状态进入正常状态-在此过渡阶段,UI似乎不完整
for 2-3 seconds and is clearly noticeable one.
2-3秒钟,显然很明显。
we are using .Activate(); 我们正在使用.Activate(); to bring this to normal state.
使它恢复正常状态。 Where we see black squares are all different controls present in the form.
我们看到黑色正方形的地方是表格中存在的所有不同控件。 Is there way to avoid this incomplete UI until a complete one is built?
有没有办法在构建完整的UI之前避免这种不完整的UI? Appreciate your suggestions.
感谢您的建议。
Declare the following property in your form - 在您的表单中声明以下属性-
protected override CreateParams CreateParams
{
get
{
CreateParams objCreateParams = base.CreateParams;
objCreateParams .ExStyle = 0x02000000;
return objCreateParams ;
}
}
Using this property, the painting of your controls remains invisible, and will display once it is done with drawing the controls. 使用此属性,控件的绘画将保持不可见,并且在完成绘制控件后将显示。
如果您在表单应用程序中使用透明键属性,请尝试将其删除并尝试yogi的代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.