--- title: "How to: Add a ToolStripContainer to a Form" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "toolbars [Windows Forms], built-in rafting" - "ToolStrip control [Windows Forms], built-in rafting" - "ToolStripContainer control [Windows Forms], adding to Windows Forms" ms.assetid: d0f55095-a833-453e-be5a-644906d75d54 --- # How to: Add a ToolStripContainer to a Form You can programmatically add a to a Windows Form and populate it with controls. ## Example The following code example demonstrates how to add a and a to a Windows Forms, how to add items to the , and how to add the to the of the . [!code-csharp[System.Windows.Forms.ToolStripContainer2#1](~/samples/snippets/csharp/VS_Snippets_Winforms/system.windows.forms.toolstripcontainer2/cs/form1.cs#1)] [!code-vb[System.Windows.Forms.ToolStripContainer2#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/system.windows.forms.toolstripcontainer2/vb/form1.vb#1)] ## Compiling the Code This code example requires: - References to the System.Drawing, System.Text, and System.Windows.Forms assemblies. ## See also - - [ToolStripContainer Control](toolstripcontainer-control.md) - [ToolStrip Control](toolstrip-control-windows-forms.md)