[英]Switching winForms and how to avoid white rectangles
i have to do an application with more forms: i first create and load the forms, after that i hide all, showing just one of them.我必须用更多的 forms 做一个应用程序:我首先创建并加载 forms,然后我隐藏所有,只显示其中一个。 With some buttons i switch between the forms by showing and hiding them with the relative functions Show()
and Hide()
The problem is that when i show a form, all the controls for an instant begin some white rectangles, after that they were loaded correctly.使用一些按钮,我通过使用相关函数Show()
和Hide()
在 forms 之间进行切换正确。
I've looked everywhere but i can't find any result.我到处寻找,但找不到任何结果。 How can i resolve this issue?我该如何解决这个问题?
you mean many forms or these forms is all in one form?你的意思是很多 forms 或这些 forms 都是一种形式?
I think you can use Invalidate()
function in the Load function.我认为您可以在 Load function 中使用Invalidate()
function。
I solved the problem by adding the properties FormBorderStyle = FormBorderStyle.None
and DoubleBuffered = true
in the constructor of a new form created with the designer.我通过在使用设计器创建的新表单的构造函数中添加属性FormBorderStyle = FormBorderStyle.None
和DoubleBuffered = true
解决了这个问题。 After that i've created an array of that type of form之后,我创建了一个该类型表单的数组
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.