Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27071

VS 2010 [RESOLVED] group box and radio buttons

$
0
0
Hi folks.

I have put some radio buttons into a group box. When I run the program and select a button, a message box pops up with a message about the current button, and then another box pops up with a message about the newly selected button. I understand that this is because CheckedChanged happens twice(for the current button and for the newly selected button).

1. What can I do so that only the change for the newly selected button is recognised? I don't care about the CheckedChanged state for the currently selected button.

2. Besides being a visual container for the radio buttons, does the group box server any other purpose, and should code for the group box be included in my code?

Thanks in advance.

Code:

Public Class Form1
    Dim frequency As String
   
    Private Sub rdoYearly_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles rdoYearly.CheckedChanged
        MsgBox("Yearly")
    End Sub

    Private Sub rdoWeekly_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles rdoWeekly.CheckedChanged
        MsgBox("Weekly")
    End Sub

    Private Sub rdoMonthly_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles rdoMonthly.CheckedChanged
        MsgBox("Monthly")
    End Sub

    Private Sub rdoDaily_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles rdoDaily.CheckedChanged
        MsgBox("Daily")
    End Sub
End Class

Attached Images
 

Viewing all articles
Browse latest Browse all 27071

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>