This documentation is archived and is not being maintained.

ToolStripContentPanel Class

Represents the center panel of a ToolStripContainer control.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

'Declaration
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<DockingAttribute(DockingBehavior.Never)> _
<ComVisibleAttribute(True)> _
Public Class ToolStripContentPanel _
	Inherits Panel
'Usage
Dim instance As ToolStripContentPanel

You can use the top, bottom, left, and right panels of the ToolStripContainer to hold ToolStrip, MenuStrip, or StatusStrip controls. Use the ToolStripContentPanel to hold controls other than these.

The following code example demonstrates adding a RichTextBox to a ToolStripContentPanel.

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms

Public Class Form1
   Inherits Form
   Private tsc As ToolStripContainer
   Private rtb As RichTextBox
   Public Sub New()
      InitializeComponent()
   End Sub

   <STAThread()>  _
   Shared Sub Main()
      Application.EnableVisualStyles()
      Application.Run(New Form1())
   End Sub 

   Private Sub InitializeComponent()
      Me.tsc = New System.Windows.Forms.ToolStripContainer()
      Me.rtb = New System.Windows.Forms.RichTextBox()
      Me.tsc.ContentPanel.Controls.Add(Me.rtb)
      Me.Controls.Add(tsc)
   End Sub 
End Class

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      System.Windows.Forms.Control
        System.Windows.Forms.ScrollableControl
          System.Windows.Forms.Panel
            System.Windows.Forms.ToolStripContentPanel

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: