0

Here's a screenshot of my application: enter image description here

Basically, depending on what option is selected I'd like to show another 'content' which can be a buttons, or forms or whatever.

What would be the best choice for this? Using MDI? I'm really new to this type of thing.

2 Answers2

2

This scenario lends itself well to tab pages, as you'd find on a TabControl.

However, since you already have a mechanism for switching between the content, you might prefer to create a series of Panels whose Dock property is set to DockStyle.Fill. When the user clicks the appropriate heading, you simply need to show the appropriate panel and call BringToFront() on it. This is essentially what the tab control does internally, anyway.

Don't forget to use SuspendLayout() and ResumeLayout() appropriately to reduce flicker, which can be a huge problem in WinForms applications, especially when there are lots of controls.

Bradley Smith
  • 13,353
  • 4
  • 44
  • 57
  • Brilliant! Sounds good on paper, let me hack something together and test it out. –  Jan 25 '11 at 03:38
0

You can position a TabControl where the buttons are not visible and control it from your buttons.

John Alexiou
  • 28,472
  • 11
  • 77
  • 133
  • What property is there to not display the buttons, but only the square content? –  Jan 25 '11 at 03:41
  • @Sergio: Unfortunately, there's no such property. However, you can subclass the tab control and add one yourself without much work. See [this answer](http://stackoverflow.com/questions/2798215/hide-tabcontrol-buttons-to-manage-stacked-panel-controls/2798241#2798241) for a drop-in solution. – Cody Gray - on strike Jan 25 '11 at 07:52