Поделиться через


RadioButton.Appearance Свойство

Определение

Возвращает или задает значение, определяющее внешний RadioButtonвид объекта.

public:
 property System::Windows::Forms::Appearance Appearance { System::Windows::Forms::Appearance get(); void set(System::Windows::Forms::Appearance value); };
public System.Windows.Forms.Appearance Appearance { get; set; }
member this.Appearance : System.Windows.Forms.Appearance with get, set
Public Property Appearance As Appearance

Значение свойства

Одно из значений Appearance . Значение по умолчанию — Normal.

Исключения

Назначенное значение не является одним из значений Appearance .

Примеры

В следующем примере кода создается и инициализируется объект RadioButton, предоставляется внешний вид элемента управления переключения, присваивается свойству AutoCheckfalseи добавляет его в объект Form.

private void InitializeMyRadioButton()
{
   // Create and initialize a new RadioButton.
   RadioButton radioButton1 = new RadioButton();

   // Make the radio button control appear as a toggle button.
   radioButton1.Appearance = Appearance.Button;

   // Turn off the update of the display on the click of the control.
   radioButton1.AutoCheck = false;

   // Add the radio button to the form.
   Controls.Add(radioButton1);
}
Private Sub InitializeMyRadioButton()
    ' Create and initialize a new RadioButton. 
    Dim radioButton1 As New RadioButton()
       
    ' Make the radio button control appear as a toggle button.
    radioButton1.Appearance = Appearance.Button
       
    ' Turn off the update of the display on the click of the control.
    radioButton1.AutoCheck = False
       
    ' Add the radio button to the form.
    Controls.Add(radioButton1)
End Sub

Комментарии

Appearance Если задано Normalзначение, RadioButton элемент управления рисуется с круговым флажоком. Если задано Buttonзначение, RadioButton то он рисуется как элемент управления, который может быть переключен на состояние вверх или вниз. Любой тип может отображать текст, изображение или оба.

Применяется к

См. также раздел