TableLayoutPanelGrowStyle TableLayoutPanelGrowStyle TableLayoutPanelGrowStyle TableLayoutPanelGrowStyle Enum

정의

TableLayoutPanel에서 기존 셀이 꽉 찼을 때 추가 행 또는 열을 얻는 방법을 지정합니다.Specifies how a TableLayoutPanel will gain additional rows or columns after its existing cells are full.

public enum class TableLayoutPanelGrowStyle
public enum TableLayoutPanelGrowStyle
type TableLayoutPanelGrowStyle = 
Public Enum TableLayoutPanelGrowStyle
상속
TableLayoutPanelGrowStyleTableLayoutPanelGrowStyleTableLayoutPanelGrowStyleTableLayoutPanelGrowStyle

필드

AddColumns AddColumns AddColumns AddColumns 2

TableLayoutPanel이 꽉 차면 추가 열을 얻습니다.The TableLayoutPanel gains additional columns after it is full.

AddRows AddRows AddRows AddRows 1

TableLayoutPanel이 꽉 차면 추가 행을 얻습니다.The TableLayoutPanel gains additional rows after it is full.

FixedSize FixedSize FixedSize FixedSize 0

TableLayoutPanel이 꽉 차도 추가 행 또는 열이 허용되지 않습니다.The TableLayoutPanel does not allow additional rows or columns after it is full.

예제

다음 예제에서는를 사용 TableLayoutPanelGrowStyle 하 여 TableLayoutPanel.GrowStyle 속성을 설정 하는 방법을 보여 줍니다.The following example shows how to use TableLayoutPanelGrowStyle to set the TableLayoutPanel.GrowStyle property. 이 예제는 TableLayoutPanel 컨트롤에 대해 제공 되는 더 큰 예제의 일부입니다.This example is part of a larger example provided for the TableLayoutPanel control.

  private void growStyleNoneBtn_CheckedChanged(
System.Object sender, 
System.EventArgs e)
  {
      this.tlpGrowStyle = TableLayoutPanelGrowStyle.FixedSize;
  }

  private void growStyleAddRowBtn_CheckedChanged(
System.Object sender, 
System.EventArgs e)
  {
      this.tlpGrowStyle = TableLayoutPanelGrowStyle.AddRows;
  }

  private void growStyleAddColumnBtn_CheckedChanged(
System.Object sender, 
System.EventArgs e)
  {
      this.tlpGrowStyle = TableLayoutPanelGrowStyle.AddColumns;
  }

  private void testGrowStyleBtn_Click(
System.Object sender, 
System.EventArgs e)
  {
      this.TableLayoutPanel1.GrowStyle = this.tlpGrowStyle;

      try
      {
          this.TableLayoutPanel1.Controls.Add(new Button());
      }
      catch(ArgumentException ex)
      {
          Trace.WriteLine(ex.Message);
      }
  }
Private Sub growStyleNoneBtn_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles growStyleNoneBtn.CheckedChanged

    Me.tlpGrowStyle = TableLayoutPanelGrowStyle.FixedSize

End Sub

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

    Me.tlpGrowStyle = TableLayoutPanelGrowStyle.AddRows

End Sub

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

    Me.tlpGrowStyle = TableLayoutPanelGrowStyle.AddColumns

End Sub

Private Sub testGrowStyleBtn_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles testGrowStyleBtn.Click

    Me.TableLayoutPanel1.GrowStyle = Me.tlpGrowStyle

    Try

        Me.TableLayoutPanel1.Controls.Add(New Button())

    Catch ex As ArgumentException

        Trace.WriteLine(ex.Message)

    End Try

End Sub

설명

하는 경우 모든 셀에는 TableLayoutPanel 채워지는 및 GrowStyle FixedSize 속성, 다른 컨트롤을 추가 하려고 하면 예외가 throw 됩니다.If all the cells in the TableLayoutPanel are filled and the GrowStyle property is set to FixedSize, an attempt to add another control will throw an exception.

적용 대상

추가 정보