RadioButton.CheckAlign Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the location of the check box portion of the RadioButton.
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; }
public System.Drawing.ContentAlignment CheckAlign { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.CheckAlign : System.Drawing.ContentAlignment with get, set
member this.CheckAlign : System.Drawing.ContentAlignment with get, set
Public Property CheckAlign As ContentAlignment
Property Value
One of the valid ContentAlignment values. The default value is MiddleLeft.
- Attributes
Exceptions
The assigned value is not one of the ContentAlignment values.
Examples
The following code example demonstrates how the CheckAlign property can be changed at run time. The check box portion of a RadioButton is moved to the right or left of the text when the Checked value changes. This example requires that a RadioButton control has been instantiated on a form and that a reference to the System.Drawing namespace has been included.
private:
Void radioButton1_CheckedChanged( System::Object^ sender,
System::EventArgs^ e )
{
// Change the check box position to be opposite its current position.
if ( radioButton1->CheckAlign == ContentAlignment::MiddleLeft )
{
radioButton1->CheckAlign = ContentAlignment::MiddleRight;
}
else
{
radioButton1->CheckAlign = ContentAlignment::MiddleLeft;
}
}
private void radioButton1_CheckedChanged(Object sender,
EventArgs e)
{
// Change the check box position to be opposite its current position.
if (radioButton1.CheckAlign == ContentAlignment.MiddleLeft)
{
radioButton1.CheckAlign = ContentAlignment.MiddleRight;
}
else
{
radioButton1.CheckAlign = ContentAlignment.MiddleLeft;
}
}
Private Sub radioButton1_CheckedChanged(sender As Object, e As EventArgs)
' Change the check box position to be opposite its current position.
If radioButton1.CheckAlign = ContentAlignment.MiddleLeft Then
radioButton1.CheckAlign = ContentAlignment.MiddleRight
Else
radioButton1.CheckAlign = ContentAlignment.MiddleLeft
End If
End Sub
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기