I have 3 radio buttons in a groupbox. I have coded what I thought was correct, but the event only works on one radio button. For example, when the form is frist opened and I click on 'rdbServiceStandard' it shows blank messagebox. If i close form and reopen then the vlaue show but will not show if \i click another radio button in the groupbox. Sometimes it dosen't fire at all. I guess my question is, have I coded correctly to retrieve values from radio buttons is a groupbox. Many thanks
groupbox
gbxServiceLevel
radio buttons
rdbServiceStandard
rbServicePermant
rdbServiceRapid
Variable to hold value
rbServiceLevel
groupbox
gbxServiceLevel
radio buttons
rdbServiceStandard
rbServicePermant
rdbServiceRapid
Variable to hold value
rbServiceLevel
Code:
Private Sub gbxServiceLevel_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gbxServiceLevel.Enter
If rdbServiceStandard.Checked Then
rbServiceLevel = "S"
ElseIf rdbServiceRapid.Checked Then
rbServiceLevel = "R"
ElseIf rdbServicePermanent.Checked Then
rbServiceLevel = "P"
End If
MessageBox.Show(rbServiceLevel)
End Sub