Results 1 to 3 of 3

Thread: [RESOLVED] group box and radio buttons

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2009
    Location
    Australia
    Posts
    130

    Resolved [RESOLVED] group box and radio buttons

    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 Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width