0% found this document useful (0 votes)
293 views

Gad Practical-No - 09

This document describes a practical exercise to design a Windows application using radio buttons and check boxes in VB.NET. It provides code samples to handle events when the radio buttons and check boxes change state, displaying different messages. It also includes example questions and exercises related to using radio buttons to change images and label text color based on selection.

Uploaded by

Amal fanse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
293 views

Gad Practical-No - 09

This document describes a practical exercise to design a Windows application using radio buttons and check boxes in VB.NET. It provides code samples to handle events when the radio buttons and check boxes change state, displaying different messages. It also includes example questions and exercises related to using radio buttons to change images and label text color based on selection.

Uploaded by

Amal fanse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Practical No. 9: Design windows application using Radio Button & Check Box.

Practical No 09

VIII. Resources required (Additional)


 If any web resources required.

X. Resources used (Additional)


 https://docs.microsoft.com/en-
us/dotnet/api/system.windows.forms.checkbox?view=netframework-4.7.2
 https://docs.microsoft.com/en-
us/dotnet/api/system.windows.forms.radiobutton?view=netframework-4.7.2

XI. Program Code


Write a program to demonstrate the use of CheckBox and RadioButton.
 Code to check Radio Buttons State

Public Class Form1


Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles
RadioButton1.CheckedChanged
If (RadioButton1.Checked = True) Then
MessageBox.Show("You are Select VB.NET")
End If
End Sub
Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles
RadioButton2.CheckedChanged
If (RadioButton2.Checked = True) Then
MessageBox.Show("You are Select JAVA")
End If
End Sub
End Class
OUTPUT :

GUI Application Development using VB.Net (22034) Page 1


Practical No. 9: Design windows application using Radio Button & Check Box.

Code to display message when the checkbox is checked -

Public Class Form1


Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles
CheckBox1.CheckedChanged
MessageBox.Show("you are select VB.NET")
End Sub

Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles


CheckBox2.CheckedChanged
MessageBox.Show("you are select JAVA")
End Sub
End Class
OUTPUT :

GUI Application Development using VB.Net (22034) Page 2


Practical No. 9: Design windows application using Radio Button & Check Box.

XIII. Practical related Questions


1. Write the program using RadioButton to change the bulb state ON/OFF.


Public Class Form1


Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles
RadioButton1.CheckedChanged
PictureBox2.Show()
PictureBox1.Hide()
End Sub

Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles


RadioButton2.CheckedChanged

PictureBox1.Show()
PictureBox2.Hide()
End Sub
End Class
OUTPUT:

GUI Application Development using VB.Net (22034) Page 3


Practical No. 9: Design windows application using Radio Button & Check Box.

2. Differentiate between RadioButton and CheckBox controls.


- In a checkbox group, a user can select more than one option. Each checkbox operates
individually, so a user can toggle each response "Checked" and "Not Checked."
- Radio buttons, however, operate as a group and provide mutually exclusive selection
values. A user can select only one option in a radio button group.

XIV. Exercise
1. Write a program to change the ForeColor of the text in Label using different
RadioButtons such Red, Green, Blue.


Public Class Form1


Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles
RadioButton1.CheckedChanged
Label1.ForeColor = Color.Red
End Sub

Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles


RadioButton2.CheckedChanged
Label1.ForeColor = Color.Green
End Sub

Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles


RadioButton3.CheckedChanged
Label1.ForeColor = Color.Blue
End Sub
End Class

GUI Application Development using VB.Net (22034) Page 4

You might also like