Choose the WinForms UI Type 选择 WinForms UI 类型

In this lesson, you will learn how to change the UI Type of the WinForms application. By default, the Solution Wizard enables the Multiple Document Interface (MDI). You can change this setting via the Model Editor, or in code. For example, you can select Single Document Interface (SDI) for your application.

在本课中,您将学习如何更改 WinForms 应用程序的 UI 类型。默认情况下,解决方案向导启用多文档接口 (MDI)。您可以通过模型编辑器或在代码中更改此设置。例如,可以为应用程序选择单个文档接口 (SDI)。

 

Follow the steps below to change the UI Type of your WinForms application using the Model Editor:

按照以下步骤使用模型编辑器更改 WinForms 应用程序的 UI 类型:

  • Invoke the Model Editor by double-clicking the Model.xafml file from the MySolution.Win project. Navigate to the Options node. This node allows you to edit different UI settings of the application. In the UIType property's dropdown list, select the desired option, for example, SingleWindowSDI.

  • 通过双击 MySolution.Win 项目中的 Model.xafml 文件来调用模型编辑器。导航到选项节点。此节点允许您编辑应用程序的不同 UI 设置。在 UIType 属性的下拉列表中,选择所需的选项,例如,单窗口SDI。

    MDI_ME

  • Run the WinForms application. Ensure that the SDI is enabled, as illustrated in the image below.

  • 运行 WinForms 应用程序。确保启用 SDI,如下图所示。

SDI

  • In SDI mode, each invoked View appears within a single window that replaces the previous one.
  • 在 SDI 模式下,每个调用的视图都会在替换前一个窗口的单个窗口中显示。

 

Note 注意
If you have selected MDI, you can customize its behavior in the Model Editor using the Options node's MdiDefaultNewWindowTarget property.

如果选择了 MDI,则可以使用选项节点的 MdiDefaultNewWindowTarget 属性在模型编辑器中自定义其行为。

To learn how to change the UI Type in code, refer to the WinApplication.ShowViewStrategy topic If you change the UI Type in code, changes made to the UIType property value in the Model Editor's Options node will be ignored.

要了解如何更改代码中的 UI 类型,请参阅 WinApplication.ShowViewStrategy 主题 如果更改代码中的 UI 类型,将忽略对模型编辑器选项节点中的 UIType 属性值所做的更改。

 

In the Main Demo, a separate WinForms project is created to demonstrate the MDI. The MainDemo application is installed in %PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/

在主演示中,将创建一个单独的 WinForms 项目来演示 MDI。主演示应用程序安装在%PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/

.

 

posted @   code first life  阅读(279)  评论(0编辑  收藏  举报
编辑推荐:
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
· 使用C#创建一个MCP客户端
点击右上角即可分享
微信分享提示