SizeType 열거형
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
컨테이너를 기준으로 UI(사용자 인터페이스) 요소의 행 또는 열 크기를 조정하는 방법을 지정합니다.
public enum class SizeType
public enum SizeType
type SizeType =
Public Enum SizeType
- 상속
필드
| Name | 값 | Description |
|---|---|---|
| AutoSize | 0 | 행 또는 열의 크기를 자동으로 조정하여 피어와 공간을 공유해야 합니다. |
| Absolute | 1 | 행 또는 열의 크기는 정확한 픽셀 수로 조정되어야 합니다. |
| Percent | 2 | 행 또는 열의 크기는 부모 컨테이너의 백분율로 조정되어야 합니다. |
예제
다음 예제에서는 개체에 TableLayoutStyle.SizeType 속성을 설정 하는 방법을 보여 있습니다 ColumnStyle . 이 코드 예제는 컨트롤에 제공된 더 큰 예제의 TableLayoutPanel 일부입니다.
private void toggleColumnStylesBtn_Click(
System.Object sender,
System.EventArgs e)
{
TableLayoutColumnStyleCollection styles =
this.TableLayoutPanel1.ColumnStyles;
foreach( ColumnStyle style in styles )
{
if( style.SizeType == SizeType.Absolute )
{
style.SizeType = SizeType.AutoSize;
}
else if( style.SizeType == SizeType.AutoSize )
{
style.SizeType = SizeType.Percent;
// Set the column width to be a percentage
// of the TableLayoutPanel control's width.
style.Width = 33;
}
else
{
// Set the column width to 50 pixels.
style.SizeType = SizeType.Absolute;
style.Width = 50;
}
}
}
Private Sub toggleColumnStylesBtn_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles toggleColumnStylesBtn.Click
Dim styles As TableLayoutColumnStyleCollection = _
Me.TableLayoutPanel1.ColumnStyles
For Each style As ColumnStyle In styles
If style.SizeType = SizeType.Absolute Then
style.SizeType = SizeType.AutoSize
ElseIf style.SizeType = SizeType.AutoSize Then
style.SizeType = SizeType.Percent
' Set the column width to be a percentage
' of the TableLayoutPanel control's width.
style.Width = 33
Else
' Set the column width to 50 pixels.
style.SizeType = SizeType.Absolute
style.Width = 50
End If
Next
End Sub
설명
열거형은 SizeType UI 요소의 행 또는 열(일반적으로 컨트롤)이 컨테이너 크기를 기준으로 크기를 조정하는 방법을 지정합니다. 이 열거형은 클래스 및 ColumnStyle 클래스에서 RowStyle 기본 크기 조정 특성을 나타내는 데 사용됩니다. 클래스는 TableLayoutPanel 차례로 이러한 스타일 클래스를 사용합니다.
기본 크기 조정 특성이 다른 행 또는 열이 있는 컨테이너를 배치하는 경우 초기 할당 후 남은 모든 공간은 스타일 TableLayoutStyle.SizeType 에 AutoSize 또는 Percent의 속성 값이 있는 행 또는 열 간에 분산됩니다.