Generates a System.WinForms.Control.Click event for the button, simulating a click by a user.
[Visual Basic] Public Sub PerformClick() [C#] public void PerformClick(); [C++] public: void PerformClick(); [JScript] public function PerformClick();
The following example evaluates a ListBox selection and the Checked property of a RadioButton. When a specified item is selected from the list box, the PerformClick method of another RadioButton is called. This code assumes that two RadioButton controls and a ListBox have been instantiated on a form.
[Visual Basic]
Private Sub MySub() ' If Item1 is selected and RadioButton2 is checked, click RadioButton1. If ListBox1.ListIndex.Text = "Item1" And _ RadioButton2.Checked = True Then RadioButton1.PerformClick() End If End Sub
RadioButton Class | RadioButton Members | System.WinForms Namespace | System.WinForms.Control.Click