限制在Win形式数在C# [英] Limitation in Number of Win Forms in C#
问题描述
我写WinForms应用程序,到目前为止,它包含37的形式。这是因为我的项目的需求。
我的问题是:
- 是有限制的C#?
- 创建表格的数量是否会对应用程序的性能?
$ b的效果$ b
感谢您的帮助。
是否有表单创建一个限制在C#?
块引用>
据我所知有一个由.NET框架强加没有这样的限制。很明显,你创建并保存在内存中,你将有,直到你用完了它的较少的内存越多的形式。和你有较少的内存可能会导致性能的下降。
在另一方面,如果你在内存中只保留目前的形式,离开GC由照顾别人离开自己的实例掉出的范围也不会有这样的问题。
I am writing WinForms application, and so far it contains 37 forms. This is because of my project's needs.
My questions are:
- Is there a limitation to the number of forms created in C#?
- Does it have an effect on application performance?
Thanks for your help.
解决方案Is there a limitation in forms creation in C# ?
AFAIK there is no such limitation imposed by the the .NET Framework. Obviously the more forms you create and keep in memory, the less memory you will have until you run out of it. And the less memory you have could lead to slower performance.
On the other hand if you keep in memory only the current form and leave the GC take care of the others by leaving their instances fall out of scope there won't be such problems.
这篇关于限制在Win形式数在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!