c# - 使用 C# 中的部分类将 WinForm 的一些控件移动到另一个 WinForm

标签 c# winforms controls partial-classes

<分区>

我有一个 WinForm,它有很多面板,每个面板都有很多控件,这使得处理这个窗体的设计非常困难,如何将每个面板移动到一个新窗体并将所有面板返回到主窗体运行时?

最佳答案

创建 UserControl 将有助于模块化您的用户界面。假设您应该为每个面板创建一个用户控件,然后在您的表单中使用这些用户控件。

The nice thing about UserControl is that they are reusable and can be designed (visually) just like the Forms are designed.

您可以引用下面的链接以了解有关 WindowsFormsUserControls 的更多信息: https://msdn.microsoft.com/en-us/library/aa302342.aspx

关于c# - 使用 C# 中的部分类将 WinForm 的一些控件移动到另一个 WinForm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41931831/

相关文章:

c# - 如何使用收缩、toArray 和 fromArray 方法改进 System.Tuple

C#/MongoDB : How do I keep a connection alive?

c# - 更改页眉高度/大小 Winform

cocoa - AMPathPopUpButton 类在哪里声明?

c# - NHibernate 复合键与复合唯一约束

c# - 在 appSettings 中为一个键使用多个值

c# - 如何创建带有 "Yes"、 "No"选项和 DialogResult 的消息框?

c# - 如何摆脱 C# 中的无限循环

.net - 百分比的 NumericUpDown 控件?

c# - 与 .NET 和 Mono 兼容的网格控件?