CheckBox.CheckAlign 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
컨트롤에 있는 확인 표시의 가로 및 세로 맞춤을 CheckBox 가져오거나 설정합니다.
public:
property System::Drawing::ContentAlignment CheckAlign { System::Drawing::ContentAlignment get(); void set(System::Drawing::ContentAlignment value); };
[System.ComponentModel.Bindable(true)]
public System.Drawing.ContentAlignment CheckAlign { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.CheckAlign : System.Drawing.ContentAlignment with get, set
Public Property CheckAlign As ContentAlignment
속성 값
값 중 ContentAlignment 하나입니다. 기본값은 MiddleLeft입니다.
- 특성
예외
할당된 값이 열거형 값 중 ContentAlignment 하나가 아닙니다.
예제
다음 코드 예제에서는 레이블에 세 속성의 값을 표시 합니다. 이 속성은 ThreeState 컨트롤 CheckAlign 의 번갈아 클릭과 값 사이의 ContentAlignmentMiddleRightMiddleLeft 대체를 번갈아 가며 대체 truefalse 합니다. 이 예제에서는 속성이 변경되고 컨트롤이 ThreeState 선택되면 속성 값이 어떻게 변경되는지 보여 집니다. 이 예제에서는 CheckBoxLabelButton 폼에서 모두 인스턴스화되었으며 레이블이 세 줄의 텍스트와 네임스페이스에 대한 참조를 표시할 수 있을 만큼 충분히 커야 합니다.System.Drawing 이 코드는 컨트롤의 Click 이벤트 처리기에서 호출되어야 합니다.
private:
void AdjustMyCheckBoxProperties()
{
// Concatenate the property values together on three lines.
label1->Text = String::Format( "ThreeState: {0}\nChecked: {1}\nCheckState: {2}",
checkBox1->ThreeState, checkBox1->Checked, checkBox1->CheckState );
// Change the ThreeState and CheckAlign properties on every other click.
if ( !checkBox1->ThreeState )
{
checkBox1->ThreeState = true;
checkBox1->CheckAlign = ContentAlignment::MiddleRight;
}
else
{
checkBox1->ThreeState = false;
checkBox1->CheckAlign = ContentAlignment::MiddleLeft;
}
}
private void AdjustMyCheckBoxProperties()
{
// Change the ThreeState and CheckAlign properties on every other click.
if (!checkBox1.ThreeState)
{
checkBox1.ThreeState = true;
checkBox1.CheckAlign = ContentAlignment.MiddleRight;
}
else
{
checkBox1.ThreeState = false;
checkBox1.CheckAlign = ContentAlignment.MiddleLeft;
}
// Concatenate the property values together on three lines.
label1.Text = "ThreeState: " + checkBox1.ThreeState.ToString() + "\n" +
"Checked: " + checkBox1.Checked.ToString() + "\n" +
"CheckState: " + checkBox1.CheckState.ToString();
}
Private Sub AdjustMyCheckBoxProperties()
' Change the ThreeState and CheckAlign properties on every other click.
If Not checkBox1.ThreeState Then
checkBox1.ThreeState = True
checkBox1.CheckAlign = ContentAlignment.MiddleRight
Else
checkBox1.ThreeState = False
checkBox1.CheckAlign = ContentAlignment.MiddleLeft
End If
' Concatenate the property values together on three lines.
label1.Text = "ThreeState: " & checkBox1.ThreeState.ToString() & ControlChars.Cr & _
"Checked: " & checkBox1.Checked.ToString() & ControlChars.Cr & _
"CheckState: " & checkBox1.CheckState.ToString()
End Sub