ToolStripContentPanel クラス
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _ <ComVisibleAttribute(True)> _ Public Class ToolStripContentPanel Inherits Panel
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] [ComVisibleAttribute(true)] public class ToolStripContentPanel : Panel
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] [ComVisibleAttribute(true)] public ref class ToolStripContentPanel : public Panel
ToolStripContainer の上側、下側、左、および右のパネルを使用すると、ToolStrip、MenuStrip、または StatusStrip の各コントロールを保持できます。ToolStripContentPanel は、これら以外のコントロールを保持するために使用します。
ToolStripContentPanel に RichTextBox を追加するコード例を次に示します。
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
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.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.ScrollableControl
System.Windows.Forms.Panel
System.Windows.Forms.ToolStripContentPanel
プラットフォーム
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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- ToolStripContentPanel クラスのページへのリンク