回复 2楼 穿越极速729
程序代码:
Option Explicit
Dim signalIndex As Byte
Private Sub Form_Load()
Combo1.Clear
Combo1.AddItem "请输入信号类型", 0
Combo1.AddItem "压力", 1
Combo1.AddItem "差压", 2
Combo1.AddItem "温度", 3
Combo1.ListIndex = 0
End Sub
Private Sub Command1_Click()
signalIndex = Combo1.ListIndex
Select Case signalIndex
Case 1, 2, 3
If Text3.Text <> "" Then
Text4.Text = Val(Text3.Text) * signalIndex * (Val(Text2.Text) + Val(Text1.Text))
Else
Text3.Text = Val(Text4.Text) / signalIndex / (Val(Text2.Text) + Val(Text1.Text))
End If
Case Else
MsgBox "请选择信号类型"
End Select
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
信号值和电流值的计算公式互逆