Dim Gca As Single
Dim Gc As Single
Dim m As Single
Dim Xco2 As Single
Dim v As Single
Dim Gmg As Single
Private Sub Command2_Click()
On Error Resume Next
m = Text1.Text
Gc = Text2.Text Text3.Text 0.01
Gca = Text8.Text 400 0.01
Gmg = Text4.Text 560 0.01
v = m (Gmg + Gca + 1.866 Gc) * 100 / Text5.Text
Text6.Text = v
End Sub
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Key = Chr(KeyAscii)
Select Case Key
Case "0" To "9"
N = Val(Left(Text1.Text, Text1.SelStart) + Key + Mid(Text1.Text, Text1.SelStart + Text1.SelLength + 1))
Case "."
If InStr(Text1.Text, ".") Then
KeyAscii = 0
MsgBox ("数据输入错误,请检查输入")
End If
Case Else
KeyAscii = 0
MsgBox ("数据输入错误,请检查是否在数值输入状态")
End Select
If Key = "-" And (InStr(Text1.Text, "-") Or Text1.SelStart <> 0) Then
KeyAscii = 0
MsgBox ("数据输入错误,请检查是否在数值输入状态")
End If
End Sub
Private Sub Text2_GotFocus()
Text2.SelStart = 0
Text2.SelLength = Len(Text2.Text)
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
Key = Chr(KeyAscii)
Select Case Key
Case "0" To "9"
N = Val(Left(Text2.Text, Text2.SelStart) + Key + Mid(Text2.Text, Text2.SelStart + Text2.SelLength + 1))
Case "."
If InStr(Text2.Text, ".") Then
KeyAscii = 0
MsgBox ("数据输入错误,请检查输入")
End If
Case Else
KeyAscii = 0
MsgBox ("数据输入错误,请检查是否在数值输入状态")
End Select
If Key = "-" And (InStr(Text2.Text, "-") Or Text2.SelStart <> 0) Then
KeyAscii = 0
MsgBox ("数据输入错误,请检查是否在数值输入状态")
End If
End Sub
Private Sub Text3_GotFocus()
Text3.SelStart = 0
Text3.SelLength = Len(Text3.Text)
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
Key = Chr(KeyAscii)
Select Case Key
Case "0" To "9"
N = Val(Left(Text3.Text, Text3.SelStart) + Key + Mid(Text3.Text, Text3.SelStart + Text3.SelLength + 1))
Case "."
If InStr(Text3.Text, ".") Then
KeyAscii = 0
MsgBox ("数据输入错误,请检查输入")
End If
Case Else
KeyAscii = 0
MsgBox ("数据输入错误,请检查是否在数值输入状态")
End Select
If Key = "-" And (InStr(Text3.Text, "-") Or Text3.SelStart <> 0) Then
KeyAscii = 0
MsgBox ("数据输入错误,请检查是否在数值输入状态")
End If
End Sub
Private Sub Text4_GotFocus()
Text4.SelStart = 0
Text4.SelLength = Len(Text4.Text)
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
Key = Chr(KeyAscii)
Select Case Key
Case "0" To "9"
N = Val(Left(Text4.Text, Text4.SelStart) + Key + Mid(Text4.Text, Text4.SelStart + Text4.SelLength + 1))
Case "."
If InStr(Text4.Text, ".") Then
KeyAscii = 0
MsgBox ("数据输入错误,请检查输入")
End If
Case Else
KeyAscii = 0
MsgBox ("数据输入错误,请检查是否在数值输入状态")
End Select
If Key = "-" And (InStr(Text4.Text, "-") Or Text4.SelStart <> 0) Then
KeyAscii = 0
MsgBox ("数据输入错误,请检查是否在数值输入状态")
End If
End Sub
Private Sub text5_GotFocus()
Text8.SelStart = 0
Text8.SelLength = Len(Text5.Text)
End Sub
Private Sub text5_KeyPress(KeyAscii As Integer)
Key = Chr(KeyAscii)
Select Case Key
Case "0" To "9"
N = Val(Left(Text5.Text, Text5.SelStart) + Key + Mid(Text5.Text, Text5.SelStart + Text5.SelLength + 1))
Case "."
If InStr(Text5.Text, ".") Then
KeyAscii = 0
MsgBox ("数据输入错误,请检查输入")
End If
Case Else
KeyAscii = 0
MsgBox ("数据输入错误,请检查是否在数值输入状态")
End Select
If Key = "-" And (InStr(Text5.Text, "-") Or Text5.SelStart <> 0) Then
KeyAscii = 0
MsgBox ("数据输入错误,请检查是否在数值输入状态")
End If
End Sub
Private Sub text8_GotFocus()
Text8.SelStart = 0
Text8.SelLength = Len(Text8.Text)
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
Key = Chr(KeyAscii)
Select Case Key
Case "0" To "9"
N = Val(Left(Text4.Text, Text4.SelStart) + Key + Mid(Text4.Text, Text4.SelStart + Text4.SelLength + 1))
Case "."
If InStr(Text4.Text, ".") Then
KeyAscii = 0
MsgBox ("数据输入错误,请检查输入")
End If
Case Else
KeyAscii = 0
MsgBox ("数据输入错误,请检查是否在数值输入状态")
End Select
If Key = "-" And (InStr(Text4.Text, "-") Or Text4.SelStart <> 0) Then
KeyAscii = 0
MsgBox ("数据输入错误,请检查是否在数值输入状态")
End If
End Sub
环评工具箱-白云窑废气计算源码
相关文章
还没有评论
发表评论