Luke
Luke

Reputation: 1258

How to do a Winforms options screen like the one in MS Office?

I'm working on a Winforms application in C# currently compiling for .NET 4.0.

I like the style of options screen used in modern versions of Word, Excel etc. If I want to do something similar ("tab" shortcuts that look like that on the left and the pages on the right), what control or combo of control do people suggest using?

So, an options screen like this. I suppose the right pane can be panels that are swapped out when the shortcuts on the left are selected. Any Winforms controls that could work as the shortcut/tab bar on the left? Excel options screen

Thank you

Upvotes: 1

Views: 870

Answers (2)

RenniePet
RenniePet

Reputation: 11658

This can be roughly simulated with standard WinForms controls. The navagation bar on the left can be a ListBox control, and then the large area containing various controls can be made with multiple Panel controls, stacked on top of each other, with each Panel containing the relevant controls. Grab the SelectedIndexChanged event on the ListBox, and call the BringToFront() method on the relevant Panel control, i.e., panel1.BringToFront() or panel2.BringToFront() or ...

So it's a bit messy, but it can be done.

At design time with Visual Studio you can only see one Panel at a time, of course. To work on the Panel you want to work on you can either select the correct Panel in the drop-down menu at the top of the Properties window, or right-click on the currently-visible Panel and select "Send to Back", and keep doing that until the Panel you want to work on is visible.

Upvotes: 1

offthat
offthat

Reputation: 400

This can be done with multiple 3rd party winforms controls out there. For example, Devexpress offers this functionality through their "BackStage view" when doing a Ribbon Form.

Upvotes: 0

Related Questions