RadioButton Constructor ()

 

Initializes a new instance of the RadioButton class.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public RadioButton()

The following code example illustrates how to create new instance of the RadioButton class using the RadioButton constructor.

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);
}

.NET Framework
Available since 1.1
Return to top
Show: