VB .NET
Slip13
Q.1) Write a Vb.net program to design the following form, allow the user to select radio buttons from Gender and Age Panel. After Selection appropriate CheckBox from Right Panel should be selected automatically. Display appropriate message into the MessageBox by clicking on Ok button. [Marks 20]
Solution
Public Class Slip13
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If RadioButton1.Checked = True And RadioButton3.Checked = True Or RadioButton2.Checked = True And RadioButton3.Checked = True Then
CheckBox2.Checked = True
MsgBox(TextBox1.Text & " Sorry You Don't Drive Car")
ElseIf RadioButton1.Checked = True And RadioButton4.Checked = True Or RadioButton2.Checked = True And RadioButton4.Checked = True Then
CheckBox1.Checked = True
MsgBox(TextBox1.Text & " You Can Drive Car")
Else
CheckBox3.Checked = True
MsgBox(TextBox1.Text & "Its All Right")
End If
End Sub
End Class
Tags:
VB .NET