クリックして評価とフィードバックをお寄せください
MSDN
MSDN ライブラリ
.NET 開発
.NET Framework 3.5
.NET Framework
System.Windows.Forms 名前空間
FlowLayoutPanel クラス
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework クラス ライブラリ
FlowLayoutPanel クラス

内容を水平方向または垂直方向に動的に配置するパネルを表します。

名前空間 :  System.Windows.Forms
アセンブリ :  System.Windows.Forms (System.Windows.Forms.dll 内)

Visual Basic (宣言)
<ComVisibleAttribute(True)> _
<DockingAttribute(DockingBehavior.Ask)> _
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
Public Class FlowLayoutPanel _
    Inherits Panel _
    Implements IExtenderProvider
Visual Basic (使用法)
Dim instance As FlowLayoutPanel
C#
[ComVisibleAttribute(true)]
[DockingAttribute(DockingBehavior.Ask)]
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)]
public class FlowLayoutPanel : Panel, IExtenderProvider
Visual C++
[ComVisibleAttribute(true)]
[DockingAttribute(DockingBehavior::Ask)]
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)]
public ref class FlowLayoutPanel : public Panel, 
    IExtenderProvider
J#
/** @attribute ComVisibleAttribute(true) */
/** @attribute DockingAttribute(DockingBehavior.Ask) */
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */
public class FlowLayoutPanel extends Panel implements IExtenderProvider
JScript
public class FlowLayoutPanel extends Panel implements IExtenderProvider

FlowLayoutPanel コントロールは、内容を水平または垂直のフロー方向に配置します。内容は、ある行から次の行、またはある列から次の列に折り返すことができます。内容を折り返さないでクリップすることもできます。

FlowDirection プロパティの値を設定してフロー方向を指定できます。FlowLayoutPanel コントロールは、フロー方向を右から左 (RTL) レイアウトに正しく反転させます。WrapContents プロパティの値を設定して、FlowLayoutPanel コントロールの内容を折り返すか、またはクリップするかを指定することもできます。

FlowLayoutPanel のその他のインスタンスを含む Windows フォーム コントロールは、FlowLayoutPanel コントロールの子になります。この機能により、実行時にフォームのサイズに合わせた高度なレイアウトを構築できます。

子コントロールのドッキングおよび固定の動作は、他のコンテナ コントロールの動作とは異なります。ドッキングおよび固定は、フロー方向の最も大きなコントロールに対して相対的です。詳細については、「方法 : FlowLayoutPanel コントロールで子コントロールを固定およびドッキングする」を参照してください。

FlowLayoutPanel コントロールの FlowDirection プロパティと WrapContents プロパティを設定する例を次に示します。コードを Form1 ソース ファイルに貼り付けます。プロジェクトに Form1.Designer.cs または Form1.Designer.vb という名前のファイルが含まれている場合、プロジェクトからそのファイルを削除します。デザイナ ファイルを表示するのに、ソリューション エクスプローラで [すべてのファイルを表示] をクリックする必要がある場合もあります。

Visual Basic
Imports System
Imports System.Windows.Forms

Public Class Form1
    Inherits System.Windows.Forms.Form

    Private Sub wrapContentsCheckBox_CheckedChanged( _
    ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles wrapContentsCheckBox.CheckedChanged

        Me.FlowLayoutPanel1.WrapContents = Me.wrapContentsCheckBox.Checked

    End Sub

    Private Sub flowTopDownBtn_CheckedChanged( _
    ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles flowTopDownBtn.CheckedChanged

        Me.FlowLayoutPanel1.FlowDirection = FlowDirection.TopDown

    End Sub

    Private Sub flowBottomUpBtn_CheckedChanged( _
    ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles flowBottomUpBtn.CheckedChanged

        Me.FlowLayoutPanel1.FlowDirection = FlowDirection.BottomUp

    End Sub

    Private Sub flowLeftToRight_CheckedChanged( _
    ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles flowLeftToRight.CheckedChanged

        Me.FlowLayoutPanel1.FlowDirection = FlowDirection.LeftToRight

    End Sub

    Private Sub flowRightToLeftBtn_CheckedChanged( _
    ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles flowRightToLeftBtn.CheckedChanged

        Me.FlowLayoutPanel1.FlowDirection = FlowDirection.RightToLeft

    End Sub

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If (components IsNot Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub
    Friend WithEvents FlowLayoutPanel1 As System.Windows.Forms.FlowLayoutPanel
    Friend WithEvents wrapContentsCheckBox As System.Windows.Forms.CheckBox
    Friend WithEvents flowTopDownBtn As System.Windows.Forms.RadioButton
    Friend WithEvents flowBottomUpBtn As System.Windows.Forms.RadioButton
    Friend WithEvents flowLeftToRight As System.Windows.Forms.RadioButton
    Friend WithEvents flowRightToLeftBtn As System.Windows.Forms.RadioButton
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents Button3 As System.Windows.Forms.Button
    Friend WithEvents Button4 As System.Windows.Forms.Button

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerNonUserCode()> Private Sub InitializeComponent()
        Me.FlowLayoutPanel1 = New System.Windows.Forms.FlowLayoutPanel
        Me.wrapContentsCheckBox = New System.Windows.Forms.CheckBox
        Me.flowTopDownBtn = New System.Windows.Forms.RadioButton
        Me.flowBottomUpBtn = New System.Windows.Forms.RadioButton
        Me.flowLeftToRight = New System.Windows.Forms.RadioButton
        Me.flowRightToLeftBtn = New System.Windows.Forms.RadioButton
        Me.Button1 = New System.Windows.Forms.Button
        Me.Button2 = New System.Windows.Forms.Button
        Me.Button3 = New System.Windows.Forms.Button
        Me.Button4 = New System.Windows.Forms.Button
        Me.FlowLayoutPanel1.SuspendLayout()
        Me.SuspendLayout()
        '
        'FlowLayoutPanel1
        '
        Me.FlowLayoutPanel1.Controls.Add(Me.Button1)
        Me.FlowLayoutPanel1.Controls.Add(Me.Button2)
        Me.FlowLayoutPanel1.Controls.Add(Me.Button3)
        Me.FlowLayoutPanel1.Controls.Add(Me.Button4)
        Me.FlowLayoutPanel1.Location = New System.Drawing.Point(47, 55)
        Me.FlowLayoutPanel1.Name = "FlowLayoutPanel1"
        Me.FlowLayoutPanel1.TabIndex = 0
        '
        'wrapContentsCheckBox
        '
        Me.wrapContentsCheckBox.Location = New System.Drawing.Point(46, 162)
        Me.wrapContentsCheckBox.Name = "wrapContentsCheckBox"
        Me.wrapContentsCheckBox.TabIndex = 1
        Me.wrapContentsCheckBox.Text = "Wrap Contents"
        '
        'flowTopDownBtn
        '
        Me.flowTopDownBtn.Location = New System.Drawing.Point(45, 193)
        Me.flowTopDownBtn.Name = "flowTopDownBtn"
        Me.flowTopDownBtn.TabIndex = 2
        Me.flowTopDownBtn.Text = "Flow TopDown"
        '
        'flowBottomUpBtn
        '
        Me.flowBottomUpBtn.Location = New System.Drawing.Point(44, 224)
        Me.flowBottomUpBtn.Name = "flowBottomUpBtn"
        Me.flowBottomUpBtn.TabIndex = 3
        Me.flowBottomUpBtn.Text = "Flow BottomUp"
        '
        'flowLeftToRight
        '
        Me.flowLeftToRight.Location = New System.Drawing.Point(156, 193)
        Me.flowLeftToRight.Name = "flowLeftToRight"
        Me.flowLeftToRight.TabIndex = 4
        Me.flowLeftToRight.Text = "Flow LeftToRight"
        '
        'flowRightToLeftBtn
        '
        Me.flowRightToLeftBtn.Location = New System.Drawing.Point(155, 224)
        Me.flowRightToLeftBtn.Name = "flowRightToLeftBtn"
        Me.flowRightToLeftBtn.TabIndex = 5
        Me.flowRightToLeftBtn.Text = "Flow RightToLeft"
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(3, 3)
        Me.Button1.Name = "Button1"
        Me.Button1.TabIndex = 0
        Me.Button1.Text = "Button1"
        '
        'Button2
        '
        Me.Button2.Location = New System.Drawing.Point(84, 3)
        Me.Button2.Name = "Button2"
        Me.Button2.TabIndex = 1
        Me.Button2.Text = "Button2"
        '
        'Button3
        '
        Me.Button3.Location = New System.Drawing.Point(3, 32)
        Me.Button3.Name = "Button3"
        Me.Button3.TabIndex = 2
        Me.Button3.Text = "Button3"
        '
        'Button4
        '
        Me.Button4.Location = New System.Drawing.Point(84, 32)
        Me.Button4.Name = "Button4"
        Me.Button4.TabIndex = 3
        Me.Button4.Text = "Button4"
        '
        'Form1
        '
        Me.ClientSize = New System.Drawing.Size(292, 266)
        Me.Controls.Add(Me.flowRightToLeftBtn)
        Me.Controls.Add(Me.flowLeftToRight)
        Me.Controls.Add(Me.flowBottomUpBtn)
        Me.Controls.Add(Me.flowTopDownBtn)
        Me.Controls.Add(Me.wrapContentsCheckBox)
        Me.Controls.Add(Me.FlowLayoutPanel1)
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.FlowLayoutPanel1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

    Friend Shared ReadOnly Property GetInstance() As Form1
        Get
            If m_DefaultInstance Is Nothing OrElse m_DefaultInstance.IsDisposed() Then
                SyncLock m_SyncObject
                    If m_DefaultInstance Is Nothing OrElse m_DefaultInstance.IsDisposed() Then
                        m_DefaultInstance = New Form1
                    End If
                End SyncLock
            End If
            Return m_DefaultInstance
        End Get
    End Property

    Private Shared m_DefaultInstance As Form1
    Private Shared m_SyncObject As New Object
#End Region


End Class

C#
using System;
using System.Windows.Forms;

public class Form1 : System.Windows.Forms.Form
{
    private void wrapContentsCheckBox_CheckedChanged(
        System.Object sender, 
        System.EventArgs e)
    {
        this.FlowLayoutPanel1.WrapContents = 
            this.wrapContentsCheckBox.Checked;
    }

    private void flowTopDownBtn_CheckedChanged(
        System.Object sender, 
        System.EventArgs e)
    {
        this.FlowLayoutPanel1.FlowDirection = FlowDirection.TopDown;
    }

    private void flowBottomUpBtn_CheckedChanged(
        System.Object sender, 
        System.EventArgs e)
    {
        this.FlowLayoutPanel1.FlowDirection = FlowDirection.BottomUp;
    }

    private void flowLeftToRight_CheckedChanged(
        System.Object sender, 
        System.EventArgs e)
    {
        this.FlowLayoutPanel1.FlowDirection = FlowDirection.LeftToRight;
    }

    private void flowRightToLeftBtn_CheckedChanged(
        System.Object sender, 
        System.EventArgs e)
    {
        this.FlowLayoutPanel1.FlowDirection = FlowDirection.RightToLeft;
    }

#region " Windows Form Designer generated code "

    public Form1() : base()
    {        

        //This call is required by the Windows Form Designer.
        InitializeComponent();

        //Add any initialization after the InitializeComponent() call

    }

    //Form overrides dispose to clean up the component list.
    protected override void Dispose(bool disposing)
    {
        if (disposing)
        {
            if (components != null)
            {
                components.Dispose();
            }
        }
        base.Dispose(disposing);
    }

    private System.Windows.Forms.FlowLayoutPanel FlowLayoutPanel1;
    private System.Windows.Forms.CheckBox wrapContentsCheckBox;
    private System.Windows.Forms.RadioButton flowTopDownBtn;
    private System.Windows.Forms.RadioButton flowBottomUpBtn;
    private System.Windows.Forms.RadioButton flowLeftToRight;
    private System.Windows.Forms.RadioButton flowRightToLeftBtn;
    private System.Windows.Forms.Button Button1;
    private System.Windows.Forms.Button Button2;
    private System.Windows.Forms.Button Button3;
    private System.Windows.Forms.Button Button4;

    //Required by the Windows Form Designer
    private System.ComponentModel.IContainer components;

    //NOTE: The following procedure is required by the Windows Form Designer
    //It can be modified using the Windows Form Designer.  
    //Do not modify it using the code editor.
    [System.Diagnostics.DebuggerNonUserCode]
    private void InitializeComponent()
    {
        this.FlowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
        this.Button1 = new System.Windows.Forms.Button();
        this.Button2 = new System.Windows.Forms.Button();
        this.Button3 = new System.Windows.Forms.Button();
        this.Button4 = new System.Windows.Forms.Button();
        this.wrapContentsCheckBox = new System.Windows.Forms.CheckBox();
        this.flowTopDownBtn = new System.Windows.Forms.RadioButton();
        this.flowBottomUpBtn = new System.Windows.Forms.RadioButton();
        this.flowLeftToRight = new System.Windows.Forms.RadioButton();
        this.flowRightToLeftBtn = new System.Windows.Forms.RadioButton();
        this.FlowLayoutPanel1.SuspendLayout();
        this.SuspendLayout();
// 
// FlowLayoutPanel1
// 
        this.FlowLayoutPanel1.Controls.Add(this.Button1);
        this.FlowLayoutPanel1.Controls.Add(this.Button2);
        this.FlowLayoutPanel1.Controls.Add(this.Button3);
        this.FlowLayoutPanel1.Controls.Add(this.Button4);
        this.FlowLayoutPanel1.Location = new System.Drawing.Point(47, 55);
        this.FlowLayoutPanel1.Name = "FlowLayoutPanel1";
        this.FlowLayoutPanel1.TabIndex = 0;
// 
// Button1
// 
        this.Button1.Location = new System.Drawing.Point(3, 3);
        this.Button1.Name = "Button1";
        this.Button1.TabIndex = 0;
        this.Button1.Text = "Button1";
// 
// Button2
// 
        this.Button2.Location = new System.Drawing.Point(84, 3);
        this.Button2.Name = "Button2";
        this.Button2.TabIndex = 1;
        this.Button2.Text = "Button2";
// 
// Button3
// 
        this.Button3.Location = new System.Drawing.Point(3, 32);
        this.Button3.Name = "Button3";
        this.Button3.TabIndex = 2;
        this.Button3.Text = "Button3";
// 
// Button4
// 
        this.Button4.Location = new System.Drawing.Point(84, 32);
        this.Button4.Name = "Button4";
        this.Button4.TabIndex = 3;
        this.Button4.Text = "Button4";
// 
// wrapContentsCheckBox
// 
        this.wrapContentsCheckBox.Location = new System.Drawing.Point(46, 162);
        this.wrapContentsCheckBox.Name = "wrapContentsCheckBox";
        this.wrapContentsCheckBox.TabIndex = 1;
        this.wrapContentsCheckBox.Text = "Wrap Contents";
        this.wrapContentsCheckBox.CheckedChanged += new System.EventHandler(this.wrapContentsCheckBox_CheckedChanged);
// 
// flowTopDownBtn
// 
        this.flowTopDownBtn.Location = new System.Drawing.Point(45, 193);
        this.flowTopDownBtn.Name = "flowTopDownBtn";
        this.flowTopDownBtn.TabIndex = 2;
        this.flowTopDownBtn.Text = "Flow TopDown";
        this.flowTopDownBtn.CheckedChanged += new System.EventHandler(this.flowTopDownBtn_CheckedChanged);
// 
// flowBottomUpBtn
// 
        this.flowBottomUpBtn.Location = new System.Drawing.Point(44, 224);
        this.flowBottomUpBtn.Name = "flowBottomUpBtn";
        this.flowBottomUpBtn.TabIndex = 3;
        this.flowBottomUpBtn.Text = "Flow BottomUp";
        this.flowBottomUpBtn.CheckedChanged += new System.EventHandler(this.flowBottomUpBtn_CheckedChanged);
// 
// flowLeftToRight
// 
        this.flowLeftToRight.Location = new System.Drawing.Point(156, 193);
        this.flowLeftToRight.Name = "flowLeftToRight";
        this.flowLeftToRight.TabIndex = 4;
        this.flowLeftToRight.Text = "Flow LeftToRight";
        this.flowLeftToRight.CheckedChanged += new System.EventHandler(this.flowLeftToRight_CheckedChanged);
// 
// flowRightToLeftBtn
// 
        this.flowRightToLeftBtn.Location = new System.Drawing.Point(155, 224);
        this.flowRightToLeftBtn.Name = "flowRightToLeftBtn";
        this.flowRightToLeftBtn.TabIndex = 5;
        this.flowRightToLeftBtn.Text = "Flow RightToLeft";
        this.flowRightToLeftBtn.CheckedChanged += new System.EventHandler(this.flowRightToLeftBtn_CheckedChanged);
// 
// Form1
// 
        this.ClientSize = new System.Drawing.Size(292, 266);
        this.Controls.Add(this.flowRightToLeftBtn);
        this.Controls.Add(this.flowLeftToRight);
        this.Controls.Add(this.flowBottomUpBtn);
        this.Controls.Add(this.flowTopDownBtn);
        this.Controls.Add(this.wrapContentsCheckBox);
        this.Controls.Add(this.FlowLayoutPanel1);
        this.Name = "Form1";
        this.Text = "Form1";
        this.FlowLayoutPanel1.ResumeLayout(false);
        this.ResumeLayout(false);
    }

#endregion
}

Visual C++
#using <System.Windows.Forms.dll>
#using <System.dll>
#using <System.Drawing.dll>

using namespace System;
using namespace System::Windows::Forms;

public ref class Form1 : public System::Windows::Forms::Form
{
private:
    void wrapContentsCheckBox_CheckedChanged(
        System::Object^ sender, System::EventArgs^ e)
    {
        this->flowLayoutPanel1->WrapContents =
            this->wrapContentsCheckBox->Checked;
    }

private:
    void flowTopDownBtn_CheckedChanged(System::Object^ sender,
        System::EventArgs^ e)
    {
        this->flowLayoutPanel1->FlowDirection = FlowDirection::TopDown;
    }

private:
    void flowBottomUpBtn_CheckedChanged(System::Object^ sender,
        System::EventArgs^ e)
    {
        this->flowLayoutPanel1->FlowDirection = FlowDirection::BottomUp;
    }

private:
    void flowLeftToRight_CheckedChanged(System::Object^ sender,
        System::EventArgs^ e)
    {
        this->flowLayoutPanel1->FlowDirection =
            FlowDirection::LeftToRight;
    }

private:
    void flowRightToLeftBtn_CheckedChanged(
        System::Object^ sender, System::EventArgs^ e)
    {
        this->flowLayoutPanel1->FlowDirection =
            FlowDirection::RightToLeft;
    }

#pragma region " Windows Form Designer generated code "

public:
    Form1(void)
    {

        // This call is required by the Windows Form Designer.
        InitializeComponent();

        // Add any initialization after the InitializeComponent()
        // call

    }

    // Form overrides dispose to clean up the component list.
protected:
    ~Form1()
    {
        if (components != nullptr)
        {
            delete components;
        }
    }

private:
    System::Windows::Forms::FlowLayoutPanel^ flowLayoutPanel1;
private:
    System::Windows::Forms::CheckBox^ wrapContentsCheckBox;
private:
    System::Windows::Forms::RadioButton^ flowTopDownBtn;
private:
    System::Windows::Forms::RadioButton^ flowBottomUpBtn;
private:
    System::Windows::Forms::RadioButton^ flowLeftToRight;
private:
    System::Windows::Forms::RadioButton^ flowRightToLeftBtn;
private:
    System::Windows::Forms::Button^ button1;
private:
    System::Windows::Forms::Button^ button2;
private:
    System::Windows::Forms::Button^ button3;
private:
    System::Windows::Forms::Button^ button4;

    // Required by the Windows Form Designer
private:
    System::ComponentModel::IContainer^ components;

    // NOTE: The following procedure is required by the Windows Form
    // Designer
    // It can be modified using the Windows Form Designer.
    // Do not modify it using the code editor.
private:
    [System::Diagnostics::DebuggerNonUserCode]
    void InitializeComponent()
    {
        this->flowLayoutPanel1 =
            gcnew System::Windows::Forms::FlowLayoutPanel();
        this->button1 = gcnew System::Windows::Forms::Button();
        this->button2 = gcnew System::Windows::Forms::Button();
        this->button3 = gcnew System::Windows::Forms::Button();
        this->button4 = gcnew System::Windows::Forms::Button();
        this->wrapContentsCheckBox =
            gcnew System::Windows::Forms::CheckBox();
        this->flowTopDownBtn = gcnew System::Windows::Forms::RadioButton();
        this->flowBottomUpBtn =
            gcnew System::Windows::Forms::RadioButton();
        this->flowLeftToRight =
            gcnew System::Windows::Forms::RadioButton();
        this->flowRightToLeftBtn =
            gcnew System::Windows::Forms::RadioButton();
        this->flowLayoutPanel1->SuspendLayout();
        this->SuspendLayout();
        //
        // flowLayoutPanel1
        //
        this->flowLayoutPanel1->Controls->Add(this->button1);
        this->flowLayoutPanel1->Controls->Add(this->button2);
        this->flowLayoutPanel1->Controls->Add(this->button3);
        this->flowLayoutPanel1->Controls->Add(this->button4);
        this->flowLayoutPanel1->Location =
            System::Drawing::Point(47, 55);
        this->flowLayoutPanel1->Name = "flowLayoutPanel1";
        this->flowLayoutPanel1->TabIndex = 0;
        //
        // button1
        //
        this->button1->Location = System::Drawing::Point(3, 3);
        this->button1->Name = "button1";
        this->button1->TabIndex = 0;
        this->button1->Text = "button1";
        //
        // button2
        //
        this->button2->Location = System::Drawing::Point(84, 3);
        this->button2->Name = "button2";
        this->button2->TabIndex = 1;
        this->button2->Text = "button2";
        //
        // button3
        //
        this->button3->Location = System::Drawing::Point(3, 32);
        this->button3->Name = "button3";
        this->button3->TabIndex = 2;
        this->button3->Text = "button3";
        //
        // button4
        //
        this->button4->Location = System::Drawing::Point(84, 32);
        this->button4->Name = "button4";
        this->button4->TabIndex = 3;
        this->button4->Text = "button4";
        //
        // wrapContentsCheckBox
        //
        this->wrapContentsCheckBox->Location =
            System::Drawing::Point(46, 162);
        this->wrapContentsCheckBox->Name = "wrapContentsCheckBox";
        this->wrapContentsCheckBox->TabIndex = 1;
        this->wrapContentsCheckBox->Text = "Wrap Contents";
        this->wrapContentsCheckBox->CheckedChanged +=
            gcnew System::EventHandler(
            this, &Form1::wrapContentsCheckBox_CheckedChanged);
        //
        // flowTopDownBtn
        //
        this->flowTopDownBtn->Location =
            System::Drawing::Point(45, 193);
        this->flowTopDownBtn->Name = "flowTopDownBtn";
        this->flowTopDownBtn->TabIndex = 2;
        this->flowTopDownBtn->Text = "Flow TopDown";
        this->flowTopDownBtn->CheckedChanged +=
            gcnew System::EventHandler(
            this, &Form1::flowTopDownBtn_CheckedChanged);
        //
        // flowBottomUpBtn
        //
        this->flowBottomUpBtn->Location =
            System::Drawing::Point(44, 224);
        this->flowBottomUpBtn->Name = "flowBottomUpBtn";
        this->flowBottomUpBtn->TabIndex = 3;
        this->flowBottomUpBtn->Text = "Flow BottomUp";
        this->flowBottomUpBtn->CheckedChanged +=
            gcnew System::EventHandler(
            this, &Form1::flowBottomUpBtn_CheckedChanged);
        //
        // flowLeftToRight
        //
        this->flowLeftToRight->Location =
            System::Drawing::Point(156, 193);
        this->flowLeftToRight->Name = "flowLeftToRight";
        this->flowLeftToRight->TabIndex = 4;
        this->flowLeftToRight->Text = "Flow LeftToRight";
        this->flowLeftToRight->CheckedChanged +=
            gcnew System::EventHandler(
            this, &Form1::flowLeftToRight_CheckedChanged);
        //
        // flowRightToLeftBtn
        //
        this->flowRightToLeftBtn->Location =
            System::Drawing::Point(155, 224);
        this->flowRightToLeftBtn->Name = "flowRightToLeftBtn";
        this->flowRightToLeftBtn->TabIndex = 5;
        this->flowRightToLeftBtn->Text = "Flow RightToLeft";
        this->flowRightToLeftBtn->CheckedChanged +=
            gcnew System::EventHandler(
            this, &Form1::flowRightToLeftBtn_CheckedChanged);
        //
        // Form1
        //
        this->AutoScaleBaseSize = System::Drawing::Size(5, 13);
        this->ClientSize = System::Drawing::Size(292, 266);
        this->Controls->Add(this->flowRightToLeftBtn);
        this->Controls->Add(this->flowLeftToRight);
        this->Controls->Add(this->flowBottomUpBtn);
        this->Controls->Add(this->flowTopDownBtn);
        this->Controls->Add(this->wrapContentsCheckBox);
        this->Controls->Add(this->flowLayoutPanel1);
        this->Name = "Form1";
        this->Text = "Form1";
        this->flowLayoutPanel1->ResumeLayout(false);
        this->ResumeLayout(false);
    }

#pragma endregion
};

J#
import System.*;
import System.Windows.Forms.*;

public class Form1 extends System.Windows.Forms.Form
{
    private void wrapContentsCheckBox_CheckedChanged(Object sender, 
        System.EventArgs e)
    {
        this.flowLayoutPanel1.set_WrapContents(this.wrapContentsCheckBox.
            get_Checked());
    } //wrapContentsCheckBox_CheckedChanged

    private void flowTopDownBtn_CheckedChanged(Object sender,
        System.EventArgs e)
    {
        this.flowLayoutPanel1.set_FlowDirection(FlowDirection.TopDown);
    } //flowTopDownBtn_CheckedChanged

    private void flowBottomUpBtn_CheckedChanged(Object sender,
        System.EventArgs e)
    {
        this.flowLayoutPanel1.set_FlowDirection(FlowDirection.BottomUp);
    } //flowBottomUpBtn_CheckedChanged

    private void flowLeftToRight_CheckedChanged(Object sender, 
        System.EventArgs e)
    {
        this.flowLayoutPanel1.set_FlowDirection(FlowDirection.LeftToRight);
    } //flowLeftToRight_CheckedChanged

    private void flowRightToLeftBtn_CheckedChanged(Object sender,
        System.EventArgs e)
    {
        this.flowLayoutPanel1.set_FlowDirection(FlowDirection.RightToLeft);
    } //flowRightToLeftBtn_CheckedChanged

    #region " Windows Form Designer generated code "
    public Form1()
    {
        //This call is required by the Windows Form Designer.
        InitializeComponent();
    } //Form1

    //Add any initialization after the InitializeComponent() call
    //Form overrides dispose to clean up the component list.
    protected void Dispose(boolean disposing)
    {
        if (disposing) {
            if (components != null) {
                components.Dispose();
            }
        }
        super.Dispose(disposing);
    } //Dispose

    private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
    private System.Windows.Forms.CheckBox wrapContentsCheckBox;
    private System.Windows.Forms.RadioButton flowTopDownBtn;
    private System.Windows.Forms.RadioButton flowBottomUpBtn;
    private System.Windows.Forms.RadioButton flowLeftToRight;
    private System.Windows.Forms.RadioButton flowRightToLeftBtn;
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.Button button2;
    private System.Windows.Forms.Button button3;
    private System.Windows.Forms.Button button4;

    //Required by the Windows Form Designer
    private System.ComponentModel.IContainer components;

    //NOTE: The following procedure is required by the Windows Form Designer
    //It can be modified using the Windows Form Designer.  
    //Do not modify it using the code editor.
    /** @attribute System.Diagnostics.DebuggerNonUserCode()
     */
    private void InitializeComponent()
    {
        this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
        this.button1 = new System.Windows.Forms.Button();
        this.button2 = new System.Windows.Forms.Button();
        this.button3 = new System.Windows.Forms.Button();
        this.button4 = new System.Windows.Forms.Button();
        this.wrapContentsCheckBox = new System.Windows.Forms.CheckBox();
        this.flowTopDownBtn = new System.Windows.Forms.RadioButton();
        this.flowBottomUpBtn = new System.Windows.Forms.RadioButton();
        this.flowLeftToRight = new System.Windows.Forms.RadioButton();
        this.flowRightToLeftBtn = new System.Windows.Forms.RadioButton();
        this.flowLayoutPanel1.SuspendLayout();
        this.SuspendLayout();
        // 
        // flowLayoutPanel1
        // 
        this.flowLayoutPanel1.get_Controls().Add(this.button1);
        this.flowLayoutPanel1.get_Controls().Add(this.button2);
        this.flowLayoutPanel1.get_Controls().Add(this.button3);
        this.flowLayoutPanel1.get_Controls().Add(this.button4);
        this.flowLayoutPanel1.set_Location(new System.Drawing.Point(47, 55));
        this.flowLayoutPanel1.set_Name("flowLayoutPanel1");
        this.flowLayoutPanel1.set_TabIndex(0);
        // 
        // button1
        // 
        this.button1.set_Location(new System.Drawing.Point(3, 3));
        this.button1.set_Name("button1");
        this.button1.set_TabIndex(0);
        this.button1.set_Text("button1");
        // 
        // button2
        // 
        this.button2.set_Location(new System.Drawing.Point(84, 3));
        this.button2.set_Name("button2");
        this.button2.set_TabIndex(1);
        this.button2.set_Text("button2");
        // 
        // button3
        // 
        this.button3.set_Location(new System.Drawing.Point(3, 32));
        this.button3.set_Name("button3");
        this.button3.set_TabIndex(2);
        this.button3.set_Text("button3");
        // 
        // button4
        // 
        this.button4.set_Location(new System.Drawing.Point(84, 32));
        this.button4.set_Name("button4");
        this.button4.set_TabIndex(3);
        this.button4.set_Text("button4");
        // 
        // wrapContentsCheckBox
        // 
        this.wrapContentsCheckBox.set_Location(new System.Drawing.Point(46, 162));
        this.wrapContentsCheckBox.set_Name("wrapContentsCheckBox");
        this.wrapContentsCheckBox.set_TabIndex(1);
        this.wrapContentsCheckBox.set_Text("Wrap Contents");
        this.wrapContentsCheckBox.add_CheckedChanged(new System.EventHandler(
            this.wrapContentsCheckBox_CheckedChanged));
        // 
        // flowTopDownBtn
        // 
        this.flowTopDownBtn.set_Location(new System.Drawing.Point(45, 193));
        this.flowTopDownBtn.set_Name("flowTopDownBtn");
        this.flowTopDownBtn.set_TabIndex(2);
        this.flowTopDownBtn.set_Text("Flow TopDown");
        this.flowTopDownBtn.add_CheckedChanged(new System.EventHandler(
            this.flowTopDownBtn_CheckedChanged));
        // 
        // flowBottomUpBtn
        // 
        this.flowBottomUpBtn.set_Location(new System.Drawing.Point(44, 224));
        this.flowBottomUpBtn.set_Name("flowBottomUpBtn");
        this.flowBottomUpBtn.set_TabIndex(3);
        this.flowBottomUpBtn.set_Text("Flow BottomUp");
        this.flowBottomUpBtn.add_CheckedChanged(new System.EventHandler(
            this.flowBottomUpBtn_CheckedChanged));
        // 
        // flowLeftToRight
        // 
        this.flowLeftToRight.set_Location(new System.Drawing.Point(156, 193));
        this.flowLeftToRight.set_Name("flowLeftToRight");
        this.flowLeftToRight.set_TabIndex(4);
        this.flowLeftToRight.set_Text("Flow LeftToRight");
        this.flowLeftToRight.add_CheckedChanged(new System.EventHandler(
            this.flowLeftToRight_CheckedChanged));
        // 
        // flowRightToLeftBtn
        // 
        this.flowRightToLeftBtn.set_Location(new System.Drawing.Point(155, 224));
        this.flowRightToLeftBtn.set_Name("flowRightToLeftBtn");
        this.flowRightToLeftBtn.set_TabIndex(5);
        this.flowRightToLeftBtn.set_Text("Flow RightToLeft");
        this.flowRightToLeftBtn.add_CheckedChanged(new System.EventHandler(
            this.flowRightToLeftBtn_CheckedChanged));
        // 
        // Form1
        // 
        this.set_ClientSize(new System.Drawing.Size(292, 266));
        this.get_Controls().Add(this.flowRightToLeftBtn);
        this.get_Controls().Add(this.flowLeftToRight);
        this.get_Controls().Add(this.flowBottomUpBtn);
        this.get_Controls().Add(this.flowTopDownBtn);
        this.get_Controls().Add(this.wrapContentsCheckBox);
        this.get_Controls().Add(this.flowLayoutPanel1);
        this.set_Name("Form1");
        this.set_Text("Form1");
        this.flowLayoutPanel1.ResumeLayout(false);
        this.ResumeLayout(false);
    } //InitializeComponent
    #endregion
} //Form1 

System..::.Object
  System..::.MarshalByRefObject
    System.ComponentModel..::.Component
      System.Windows.Forms..::.Control
        System.Windows.Forms..::.ScrollableControl
          System.Windows.Forms..::.Panel
            System.Windows.Forms..::.FlowLayoutPanel
この型のすべてのパブリック static (Visual Basic では Shared) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

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

.NET Framework および .NET Compact Framework は、各プラットフォームのすべてのバージョンをサポートしていません。サポートされているバージョンの一覧については、「.NET Framework システム要件」を参照してください。

.NET Framework

サポート対象 : 3.5、3.0 SP1、3.0、2.0 SP1、2.0
コミュニティ コンテンツ   コミュニティ コンテンツとは
新しいコンテンツの追加 RSS