显示选中的单选按钮

时间:2012-11-15 22:27:59

标签: vb.net button radio-button

我在1个标签中显示3个单选按钮时出现问题,选择了单选按钮,所以我有3个单选按钮,

单选按钮名称:

Single
Season
Flex

所以如果选择单选按钮1显示在lblReceiptAns.Text =“选项:”,

Select Case True
  Case radSingle.Checked
    Pricez = CDbl(txtTickets.Text) * SINGLETICKETS
    TotalPricce = Pricez
  Case radSeason.Checked
    Pricez = CDbl(txtTickets.Text) * SEASONTICKCETS
    TotalPricce = Pricez
  Case radFlexPack.Checked
    Pricez = CDbl(txtTickets.Text) * FLEXPACK
    TotalPricce = Pricez
End Select

If txtVenue.Text = "STADIUM" Then
  lblReceiptAns.Visible = True
  lblReceiptAns.Text = "Option: " & 
Else

1 个答案:

答案 0 :(得分:1)

我会创建一个新的模块级字符串变量 - Say RadioButtonSelected,然后在RadioButton_CheckChanged模块中设置它的值。

然后你只需:

lblReceiptAns.Text = "Option: " & RadioButtonSelected