简体   繁体   中英

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#. 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. 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.

You can create a user control for each view that a NavBar button would invoke. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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