TableLayoutControlCollection.Add(Control, Int32, Int32) 메서드

정의

컬렉션에 지정된 컨트롤을 추가하고 지정된 셀에 배치합니다.

public:
 virtual void Add(System::Windows::Forms::Control ^ control, int column, int row);
public virtual void Add(System.Windows.Forms.Control control, int column, int row);
override this.Add : System.Windows.Forms.Control * int * int -> unit
Public Overridable Sub Add (control As Control, column As Integer, row As Integer)

매개 변수

control
Control

추가할 컨트롤입니다.

column
Int32

배치할 열 control 입니다.

row
Int32

배치할 행 control 입니다.

예외

- column 1보다 작거나 row 작습니다.

설명

를 사용하면 Add.의 control셀 위치를 지정할 수 있습니다. 매개 변수와 control 매개 변수를 모두 column 제공하여 특정 셀에 할당 row 하거나 열 또는 행 값만 지정하고 다음 열린 셀에 배치 LayoutEnginecontrol 수 있습니다. 컨트롤이 컨트롤의 위치로 흐르 도록 하는 것으로 알려져 있습니다 TableLayoutPanel .

고정 행 위치를 차지하려면 column -1 설정합니다control.

고정 열 위치를 차지하려면 row -1 설정합니다control.

둘 다 column -1 row 이 아니면 control (column, row)에 의해 지정된 절대 위치에 추가됩니다.

둘 다 column 및 -1 row 로 설정하면 값으로 정의된 control 특정 흐름 동작을 사용하여 첫 번째 열린 위치 TableLayoutPanel.GrowStyle 로 흐릅니다. 이는 메서드를 사용하는 Control.ControlCollection.Add 것과 같습니다.

컨트롤의 실제 현재 위치에 도착하려면 메서드를 TableLayoutPanel.GetPositionFromControl 사용합니다. 이 메서드는 열 또는 행 스패닝을 포함하여 전체 TableLayoutPanel 컨트롤 상태를 고려하고 해당 컨트롤과 TableLayoutPanel.LayoutEngine 속성이 -1로 Column 설정된 컨트롤을 배치한 경우 Row 를 고려합니다.

적용 대상

추가 정보