请高手帮忙写个vb代码,实现当输入信号值时,点击计算得出电流值;当输入电流值时,点击计算得出信号值
求教高手:在信号类型中选择相应的信号(压力、差压、温度),输入已知最大值、最小值。当输入信号值时,点击计算得出电流值;当输入电流值时,点击计算得出信号值。信号类型中的各个信号,对应的计算公式各不同。请高手帮忙写个VB代码,
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