0

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.

Bohn
  • 26,091
  • 61
  • 167
  • 254

1 Answers1

1

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
  • 868,454
  • 176
  • 1,908
  • 1,964
  • 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 – Bohn Jun 25 '10 at 22:38
  • Switch to the ToolStrip control, which supports this. Alternatively, add buttons to your original toolbar and show/hide each button. – SLaks Jun 25 '10 at 22:42
  • 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 ... – Bohn Jun 25 '10 at 22:47