简体   繁体   English

使用DevExpress NavBar控件的WinForm以及如何正确更改目标面板

[英]WinForm with DevExpress NavBar Control and How to Change the Target Panel Correctly

I want to do this correctly instead of a hack, so help is appreciated 我想正确地做这个而不是黑客,所以请帮助

I am starting a very basic project, using a DevExpress NavBar control in a WinForms project, in C#. 我正在使用C#中的WinForms项目中的DevExpress NavBar控件启动一个非常基本的项目。 Easy enough. 很容易。

NavBar is in the left part of a splitter, and I want the right part of the splitter to change based on what item you have clicked on in the nav bar. NavBar位于拆分器的左侧,我希望拆分器的右侧部分根据您在导航栏中单击的项目进行更改。 You know, one second its a grid, then next it's a calendar. 你知道,一秒钟它是一个网格,然后接下来它是一个日历。

I could screw around with hiding and showing windows, but I know that's not right. 我可以隐藏并展示窗户,但我知道这不对。

Just using a tabbed control seems real close, except I don't need the tabs, the nav bar is where the user picks what he wants to see. 只是使用选项卡控件似乎非常接近,除了我不需要选项卡,导航栏是用户选择他想要看到的内容。

So would I use panels in some way? 那么我会以某种方式使用面板吗? Some type of modified tab control? 某些类型的修改标签控件? Do i just pile on top of one another my various pages of controls for each nav option? 我是否只为每个导航选项堆叠了各种控件页面? So many pieces, doesn't seem to be any clear documentation on how to accomplish this very simple problem... after an hour of digging, thought I would ask. 这么多件,似乎没有关于如何完成这个非常简单的问题的任何明确的文件......经过一个小时的挖掘,我想我会问。

Thanks. 谢谢。

So would I use panels in some way? 那么我会以某种方式使用面板吗? Some type of modified tab control? 某些类型的修改标签控件?

You can use tab control in other way. 您可以以其他方式使用选项卡控件。 Just hide the XtraTabControl headers via the XtraTabControl.ShowTabHeaders option. 只需通过XtraTabControl.ShowTabHeaders选项隐藏XtraTabControl标头即可

You can create a user control for each view that a NavBar button would invoke. 您可以为NavBar按钮调用的每个视图创建用户控件。 When the user clicks the button you dynamically generate that view and add to the right part of the splitter. 当用户单击该按钮时,您将动态生成该视图并添加到拆分器的右侧部分。 What ever user control was there before you dispose of. 处理之前用户控制的是什么。

This will keep your app very light when executing and make it composable. 这将使您的应用程序在执行时非常轻,并使其可组合。

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

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