Export (0) Print
Expand All
0 out of 3 rated this helpful - Rate this topic

ToolStripContentPanel Class

Note: This class is new in the .NET Framework version 2.0.

Represents the center panel of a ToolStripContainer control.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] 
[ComVisibleAttribute(true)] 
public class ToolStripContentPanel : Panel
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ 
/** @attribute ComVisibleAttribute(true) */ 
public class ToolStripContentPanel extends Panel
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) 
ComVisibleAttribute(true) 
public class ToolStripContentPanel extends Panel

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.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;


public class Form1 : Form
{
    private ToolStripContainer tsc;
    private RichTextBox rtb;

    public Form1()
    {
        InitializeComponent();
    }    
[STAThread]
static void Main()
    {
        Application.EnableVisualStyles();
        Application.Run(new Form1());
    }

    private void InitializeComponent()
    {
        this.tsc = new System.Windows.Forms.ToolStripContainer();
        this.rtb = new System.Windows.Forms.RichTextBox();
        this.tsc.ContentPanel.Controls.Add(this.rtb);
        this.Controls.Add(this.tsc);

    }
}

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 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.