TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

ToolStripContainer Control: Dock, Properties

This article describes the ToolStripContainer control in Windows Forms.

ToolStripContainer adds user interface functionality.

It serves as a way to allow ToolStrips (which contain buttons or other controls) to be dragged around the edges of a Form. We specify how ToolStrips can be located and arranged.

Start. To begin, open your Windows Forms project and drag the ToolStripContainer to the Form. Next, you can optionally Dock the ToolStripContainer in the Form. Please see the next section.

When you first add the ToolStripContainer to your project, try clicking on the "Dock Fill in Form" link in Visual Studio 2010. This will expand the ToolStripContainer to reach the four sides of the enclosing form.

Blue arrows. To enable the ToolStripContainer on a certain side, click the blue arrow on that side to expand it. If you add a ToolStrip to that side, try clicking the blue arrow again: the area will expand and more controls can be placed there.

Add ToolStrip. Inside the ToolStripContainer, you can add ToolStrip instances. Make sure you use the blue arrows to expand the side you want to use. Then, drag a ToolStrip to the top, right, left or bottom area you expanded.

And: The ToolStrip will be located in that area by default. A user will be able to drag it to another area.

Properties. With the ToolStripContainer, you can address the top, right, left and bottom panels through your C# code. If you have some ToolStrips located there, you can use these properties to get references to them.

Also: There exist Visibility properties. These properties adjust whether the panel is seen.

Panel types

TopToolStripPanel
RightToolStripPanel
BottomToolStripPanel
LeftToolStripPanel

Visibility properties. By assigning a Visibility property to false, you make it so a ToolStrip cannot be dragged to that side. By default, all sides have a Visibility of true. Here are the properties.

PanelVisible properties

TopToolStripPanelVisible
RightToolStripPanelVisible
BottomToolStripPanelVisible
LeftToolStripPanelVisible

 

Summary. With ToolStripContainer, we can arrange ToolStrips in an intuitive and easy to manage way. Even though the ToolStripContainer makes it possible to have many ToolStrips, this is likely to frustrate users.

And: Because of this, ToolStripContainers should be used only when it is necessary to have many ToolStrips.


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf