我想制作一个程序,该程序取决于某人单击的单选按钮(每个按钮只有 1 个GroupBox
)和总共 5 个不同的组框。特定值将添加到输入的 num1Textbox 值中。
问题是可以做到吗?还是我在浪费时间尝试学习它。我对 VB 很陌生.. 并且只完成了一个 cpl 程序,它为高尔夫程序添加 - 多重 - 除法和减去值以进行推杆.. 这一次我知道它会更复杂。
下面是该程序的图片。
有人会进入 Yard to Hole = 145(每次都是不同的数字)
然后,他们会为每个(5 个不同的选项)选择 1 个单选按钮,GroupBox
并且值 145 会根据选择的选项相应地增加或减少。
对不起,它不允许我在这里上传图片:(所以我在这里上传了它。
抱歉,不知道您需要一个帐户才能在那里查看表格。我会尝试找到一个新的地方。1分钟
让我们在这里试试 http://i1311.photobucket.com/albums/s667/Steve_Lunney/design_zps9c2f89da.jpg
任何帮助将不胜感激......提前谢谢你
这就是我正在尝试的......作为某人的建议
但是在每个这些状态下 spinGroupBox.spin1RadioButton.Checked 我得到波浪线,当我把鼠标放在它上面时它说 - 'upRadioButton' 不是'System.Windows.Forms.Groupbox'的成员
Private Sub calculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calculateButton.Click
Dim spinGroupBox As New GroupBox()
Dim spin1RadioButton As RadioButton
Dim spin2RadioButton As RadioButton
Dim spin3RadioButton As RadioButton
Dim spin4RadioButton As RadioButton
Dim spin5RadioButton As RadioButton
Dim num1TextBox As Integer
Dim num2TextBox As Integer
Dim spin1b As Decimal
Dim resultA As Integer
Select Case True
Case spinGroupBox.spin1RadioButton.Checked
spin1b = 0.095
Case spinGroupBox.spin2RadioButton.Checked
spin1b = 0.085
Case spinGroupBox.spin3RadioButton.Checked
spin1b = 0.08
'etc
End Select
resultA = spin1b
' Create and initialize a GroupBox and a Button control.
Dim windGroupBox As GroupBox
Dim upRadioButton As RadioButton
Dim ulRadioButton As RadioButton
Dim urRadioButton As RadioButton
Dim downRadioButton As RadioButton
Dim dlRadioButton As RadioButton
Dim drRadioButton As RadioButton
Dim leftRadioButton As RadioButton
Dim rightRadioButton As RadioButton
Dim wind1b As Decimal
Dim resultb As Integer
Select Case True
Case windGroupBox.upRadioButton.Checked
wind1b = 0.095
Case windGroupBox.ulRadioButton.Checked
wind1b = 0.085
Case windGroupBox.urRadioButton.Checked
wind1b = 0.075
Case windGroupBox.downRadioButton.Checked
wind1b = 0.07
Case windGroupBox.dlRadioButton.Checked
wind1b = 0.065
Case windGroupBox.drRadioButton.Checked
wind1b = 0.06
Case windGroupBox.leftRadioButton.Checked
wind1b = 0.055
Case windGroupBox.rightRadioButton.Checked
wind1b = 0.05
End Select
resultb = wind1b
End Sub