简体   繁体   English

如何在WPF或C#中制作多窗格GUI?

[英]How to make Multi-Pane GUI in WPF or C#?

I have seen this user interface in some screen shots of some RSS Readers. 我在一些RSS阅读器的屏幕截图中已经看到了该用户界面。 It is a multi-pane user interface. 这是一个多窗格用户界面。 THere are three panels or "panes" to the window, in other words, the window is divided into three parts and the user is able to mouse over the division and click on the seperation bar and resize the section. 这是窗口的三个面板或“窗格”,换言之,该窗口分为三个部分,用户可以将鼠标悬停在该划分上,然后单击分隔栏并调整该部分的大小。

How is this sort of GUI developed in C#? 这种GUI如何用C#开发?

In WinForms, this is done with a SplitContainer . 在WinForms中,这是通过SplitContainer完成的。 The Orientation property can be used to get vertical or horizontal splits. Orientation属性可用于获取垂直或水平拆分。 You can also nest splitcontainers to get multiple splits. 您还可以嵌套splitContainer以获取多个拆分。

In WPF there is no SplitContainer, but the same effect can be achieved with a Grid and a GridSplitter . 在WPF中没有SplitContainer,但是使用Grid和GridSplitter可以实现相同的效果。

Finally, note that "WPF or C#" is a false dichotomy. 最后,请注意“ WPF或C#”是错误的二分法。 WPF and WinForms are just UI frameworks in the .NET framework. WPF和WinForms只是.NET框架中的UI框架。 Both can be used with any .NET language, including C#, VB.NET, etcetera. 两者都可以与任何.NET语言一起使用,包括C#,VB.NET等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM