VB里的combo1()组件、textbox1()组件、label1()组的应用问题。
我想实现一些功能:当comb1选到一个规格时时,对应着一个单位值,然后在text1()里面输入长度,label1()里面的caption显示结果为单位值*长度的积,这怎么...
我想实现一些功能:当comb1选到一个规格时时,对应着一个单位值,然后在text1()里面输入长度,label1()里面的caption显示结果为单位值*长度的积,这怎么编程啊?
Private Sub Command1_Click()
Dim i As Integer
For i = 0 To 70
If combol(i).Text = "3×185+1×95" Then
R(i) = 0.0991
ElseIf Combo1(i).Text = "3×120+1×70" Then
R(i) = 0.153
ElseIf Combo1(i).Text = "3×95+1×50" Then
R(i) = 0.193
ElseIf Combo1(i).Text = "3×70+1×35" Then
R(i) = 0.268
ElseIf Combo1(i).Text = "3×50+1×25" Then
R(i) = 0.387
ElseIf Combo1(i).Text = "3×35+1×16" Then
R(i) = 0.524
ElseIf Combo1(i).Text = "3×25+1×16" Then
R(i) = 0.727
ElseIf Combo1(i).Text = "3×16+1×10" Then
R(i) = 1.15
ElseIf Combo1(i).Text = "3×10+1×6" Then
R(i) = 1.83
ElseIf Combo1(i).Text = "3×6+1×4" Then
R(i) = 2
ElseIf Combo1(i).Text = "3×4+1×2.5" Then
R(i) = 3
End If
Label1(i).Caption = R(i) * Text1(i).Text
Next
这样编对吗?谁能帮帮我???
End Sub 展开
Private Sub Command1_Click()
Dim i As Integer
For i = 0 To 70
If combol(i).Text = "3×185+1×95" Then
R(i) = 0.0991
ElseIf Combo1(i).Text = "3×120+1×70" Then
R(i) = 0.153
ElseIf Combo1(i).Text = "3×95+1×50" Then
R(i) = 0.193
ElseIf Combo1(i).Text = "3×70+1×35" Then
R(i) = 0.268
ElseIf Combo1(i).Text = "3×50+1×25" Then
R(i) = 0.387
ElseIf Combo1(i).Text = "3×35+1×16" Then
R(i) = 0.524
ElseIf Combo1(i).Text = "3×25+1×16" Then
R(i) = 0.727
ElseIf Combo1(i).Text = "3×16+1×10" Then
R(i) = 1.15
ElseIf Combo1(i).Text = "3×10+1×6" Then
R(i) = 1.83
ElseIf Combo1(i).Text = "3×6+1×4" Then
R(i) = 2
ElseIf Combo1(i).Text = "3×4+1×2.5" Then
R(i) = 3
End If
Label1(i).Caption = R(i) * Text1(i).Text
Next
这样编对吗?谁能帮帮我???
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询