将大窗户分成几部分 [英] Divide large windows form in pieces

查看:38
本文介绍了将大窗户分成几部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在单独的设计器文件中划分一个大的 C# windows 窗体.

I need to divide a large C# windows form in separate designer-files.

我添加了一个类图来表明我的项目的复杂性.
该项目由 1 个主要表单(绿色)和一些较小的、不太重要的表单(蓝色)组成.
主要形式依赖于提供串行和 SQL 连接的几个类(红色).

I added a class-diagram to indicate the complexity of my project.
The project consists of 1 main form (Green) and some smaller, less important forms (Blue).
The main form relies on several classes (Red) which provide Serial and SQL connections.

问题:
主窗体有 2422 个控件,这些控件由设计器文件构建.这些控件排列在几个标签页中,这使得将表单分成不同的部分成为可能.
但是,它们仍然需要以一种形式出现.

The problem:
The main form has 2422 controls which are constructed by the designer file. These controls are arranged in several tab pages which makes it possible to devide the form in different parts.
However, they still need to appear in one form.

实现这一目标的最佳方法是什么?

What is the best way to accomplish this?

*除了 Windows 窗体设计器之外,不可能使用其他任何东西

*It is impossible to use anything else than the Windows Forms designer

推荐答案

您可以使用 UserControls 并在那里对逻辑独立部分进行分组.并根据要求加载它们.

You can use UserControls and group the logical stand-alone parts there. And load them on request.

这篇关于将大窗户分成几部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆