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

VS 2010 Retrieve radion button values from groupbox

$
0
0
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

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


Viewing all articles
Browse latest Browse all 27353

Trending Articles



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