views:

24

answers:

1

C# WinForms:

I have a static toolbar that is always on my form. but sometimes for example when user selects a command from a menu, I wish to have a second toolbar that is getting added to the right hand side of my static toolbar. How can I accomplish that?

Thanks.

+1  A: 

You can make a second ToolStrip in the designer and set its Visible property to false.

Then, when the menu command is clicked, set the second toolstrip's Visible to true.

SLaks
thanks, but even at design time can I add it to the right of the first toolbar? Its looks like the toolbar are all anchored and docked so each of them fills the whole horizontal area of the form
BDotA
Switch to the ToolStrip control, which supports this. Alternatively, add buttons to your original toolbar and show/hide each button.
SLaks
Show/Hide buttons on the original toolbar? Why?I want the New toolbar to show at the right hand side of the original toolbar.. it is a separate toolbar for itself, but its location should be at the right hand side of the original toolbar, But still at the same line... not below it or above it ...
BDotA