SpeakComputers.com online store
Electronics Software Computers Handhelds Laptops and Tablets Mobile Phones Digital Cameras Camcorders Games Music Books Sport Mens and Womens Watches Power Tools Household appliances
Software Downloads 2012 Software Mac Software Security Student Editions Windows 7 Office 2010

VB.NET RadioButton Control.

The VB.NET RadioButton control allows you to choose one item within the parent control or group of items. When a user selects one option within a group of options the other options clear automatically. Typically the options are on the line of Yes/No, Male/Female, True/False etc. The RadioButton is very similiar to the CheckBox control. The main difference is with the CheckBox control, the user can select multiple choices within the same group of options.

Namespace: System::Windows::Forms
System.Windows.Forms (in system.windows.forms.dll)

Creating 2 new VB.NET Windows forms RadioButtons.
Dim Mradiobutton As New RadioButton
Dim Fradiobutton As New RadioButton

Assigning a text value to the VB.NET RadioButton controls.
Mradiobutton.Text = "Male"
Fradiobutton.Text = "Female"

Assigning a new location for the VB.NET Windows Forms RadioButton Controls.
Mradiobutton.Location = New Point(10, 10)
Fradiobutton.Location = New Point(10, 30)

Assigning the Check value to the RadioButton controls.
Mradiobutton.Checked = True
Fradiobutton.Checked = False

Adding a VB.NET RadioButton controls to the form.
Me.Controls.AddRange(New RadioButton() {Mradiobutton, Fradiobutton})

Creating a CheckedChanged Event for the VB.NET RadioButton controls.
AddHandler Fradiobutton.CheckedChanged, AddressOf Fradiobutton_checkchanged
AddHandler Mradiobutton.CheckedChanged, AddressOf Mradiobutton_checkedchanged

Responding to the VB.NET RadioButton CheckedChanged event.
Male RadioButton.
Private Sub Mradiobutton_checkedchanged(ByVal sender As Object, ByVal e As EventArgs)
MessageBox.Show("Male checked")
End Sub

Female RadioButton.
Private Sub Fradiobutton_checkchanged(ByVal sender As Object, ByVal e As EventArgs)
MessageBox.Show("Female checked")
End Sub

VB.NET RadioButton control Tutorial.
Home About Privacy Policy Resouces Products Map

Copy Right 2006 SpeakComputers.com - All Rights Reserved.
Learn Spanish
Learn Spanish for free with our online and free tutorials with audio. See our grammar sections, verb sections and drills, massive vocabulary sections with audio, our Spanish verb conjugator and more.
Free Text to Speech Software
Get software that makes your computer read text aloud.
Text to Speech software that supports natural sounding TTS voices.
Convert text to MP3 files
Listen to webpages aloud or convert them to sound files