views:

55

answers:

4

I'm using Winforms/ C# .NET.

In the ToolStrip I've different buttons, each should take us to a different page. (I don't know what term should I use for this.)

I'm unable to express it clearly. The closely related software that depicts what I want is ccleaner see image here: http://i.imagehost.org/0569/cc.gif alt text

on selection, of each tab/button/(Idon't know what it actually is) from the options on left side ccleaner, registry, Tasks, Options. The content in the red border changes.

This is what I exactly want. also, How can I get this kind of look?

A: 

You may owner draw tab control / tree view control to achieve similar result

Anton Setiawan
+1  A: 

My solution is a bit more complicated, but creates a nice effect. Make each page you want to show derive from UserControl and put all its controls on it. My "tabs" were actually an owner drawn ListView in Tile mode. With owner drawing I achieved a nice mouse over effect on the ListView. When the selection on the ListView changes, show the appropriate page.

Matthew Ferreira
A: 

Well, if you're ambitious and want to go out on a limb, I do it this way.

Basically, I write what looks like a C# function to create the controls that I want at any point in time.

I say "looks like" because it uses a special control structure, called Differential Execution, that allows it to be called in different modes.

  • In Show mode, it does just that - create and place the controls.

  • In Erase mode, it does the exact opposite, removing the controls it put there earlier.

  • In Update mode, it does whatever has to be done to incrementally alter the set of controls from what it was to what is wanted.

  • In Event mode, it processes UI input events, routing them to the proper control and doing what you want done.

Why?

  • You never have to write an event handler. You never have to create a variable to hold a control, or create a control ID.

  • There is no limit to how many controls could potentially be on the screen, because when controls are not visible, they are not taking up storage. (And it automatically, and trivially, garbage collects controls.)

  • A routine to paint what you want is way easier to write than one that paints, erases, incrementally updates, and handles events.

  • Also, it handles conditionals, subroutines, loops, etc. to let you be really expressive with what you paint on the window, it lives in your code and has access to your data structure, and it automatically handles all kinds of data-binding with no coding effort.

Our product has a lot of UI, with a zillion options. I couldn't do it any other way.

Mike Dunlavey
A: 

There could be two ways to achieve this

  1. Not very efficient one :
    Take a tab control and add tabs for each button action(navigation action on the left). On click of navigation button make visible only one tab and hide others. This will achieve the same effect.

  2. Better approach which I think Create composite controls for each screen and load it on to the right side container area dynamically on click of navigation button.

geekonweb