
Private Sub Command1_Click()
If Text1.Text = "" Or Val(Text1.Text) < 0 Then MsgBox "請輸入正確的功率,重試!":
If Text2.Text = "" Or Val(Text2.Text) < 0 Then MsgBox "請輸入正確的帶輪轉速,重試!":
If Text3.Text = "" Or Val(Text3.Text) < 0 Then MsgBox "請輸入正確的傳動比,重試!":
If Option8.Value = False And Option9.Value = False Then MsgBox "啟動情況請選擇一項,重試!":
If Option5.Value = False And Option6.Value = False And Option7.Value = False Then MsgBox "每天作業小時數請選擇一項,重試!":
If Option1.Value = False And Option2.Value = False And Option3.Value = False And Option4.Value = False Then MsgBox "載荷變動情況請選擇一項,重試!":
Dim p As Double, n1 As Double, i As Double, Ka As Double
p = Val(Text1.Text)
n1 = Val(Text2.Text)
i = Val(Text3.Text)
Ka = Val(Text4.Text)
If Option8.Value = True And Option5.Value = True And Option1.Value = True Then
Ka = 1
Text4.Text = Str(Ka)
End If
If Option8.Value = True And Option5.Value = True And Option2.Value = True Then
Ka = 1.1
End If
If Option8.Value = True And Option5.Value = True And Option3.Value = True Then
Ka = 1.2
End If
If Option8.Value = True And Option5.Value = True And Option4.Value = True Then
Ka = 1.3
End If
If Option8.Value = True And Option6.Value = True And Option1.Value = True Then
Ka = 1.1
End If
If Option8.Value = True And Option6.Value = True And Option2.Value = True Then
Ka = 1.2
End If
If Option8.Value = True And Option6.Value = True And Option3.Value = True Then
Ka = 1.3
End If
If Option8.Value = True And Option6.Value = True And Option4.Value = True Then
Ka = 1.4
End If
If Option1.Value = True And Option7.Value = True And Option1.Value = True Then
Ka = 1.2
End If
If Option8.Value = True And Option7.Value = True And Option2.Value = True Then
Ka = 1.3
End If
If Option8.Value = True And Option7.Value = True And Option3.Value = True Then
Ka = 1.4
End If
If Option8.Value = True And Option7.Value = True And Option4.Value = True Then
Ka = 1.5
If Option9.Value = True And Option5.Value = True And Option1.Value = True Then
Ka = 1.1
End If
If Option9.Value = True And Option5.Value = True And Option2.Value = True Then
Ka = 1.2
End If
If Option9.Value = True And Option5.Value = True And Option3.Value = True Then
Ka = 1.4
End If
If Option9.Value = True And Option5.Value = True And Option4.Value = True Then
Ka = 1.5
End If
If Option9.Value = True And Option6.Value = True And Option1.Value = True Then
Ka = 1.2
End If
If Option9.Value = True And Option6.Value = True And Option2.Value = True Then
Ka = 1.3
End If
If Option9.Value = True And Option6.Value = True And Option3.Value = True Then
Ka = 1.5
End If
If Option2.Value = True And Option6.Value = True And Option4.Value = True Then
Ka = 1.6
End If
If Option9.Value = True And Option7.Value = True And Option1.Value = True Then
Ka = 1.3
End If
If Option9.Value = True And Option7.Value = True And Option2.Value = True Then
Ka = 1.4
End If
If Option9.Value = True And Option7.Value = True And Option3.Value = True Then
Ka = 1.6
End If
If Option9.Value = True And Option7.Value = True And Option4.Value = True Then
Ka = 1.8
End If
Ka = Ka
Text4.Text = Ka
Pca = Ka * p
Text16.Text = Pca
End If
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Text16.Text = " "
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
Option5.Value = False
Option6.Value = False
Option7.Value = False
Option8.Value = False
Option9.Value = False
End Sub
uj5u.com熱心網友回復:
Private Sub Command1_Click()
Dim p As Double, n1 As Double, i As Double, Ka As Double, Pca As Double
If Text1.Text = "" Or Val(Text1.Text) < 0 Then MsgBox "請輸入正確的功率,重試!":
If Text2.Text = "" Or Val(Text2.Text) < 0 Then MsgBox "請輸入正確的帶輪轉速,重試!":
If Text3.Text = "" Or Val(Text3.Text) < 0 Then MsgBox "請輸入正確的傳動比,重試!":
If Option8.Value = False And Option9.Value = False Then MsgBox "啟動情況請選擇一項,重試!":
If Option5.Value = False And Option6.Value = False And Option7.Value = False Then MsgBox "每天作業小時數請選擇一項,重試!":
If Option1.Value = False And Option2.Value = False And Option3.Value = False And Option4.Value = False Then MsgBox "載荷變動情況請選擇一項,重試!":
p = Val(Text1.Text)
n1 = Val(Text2.Text)
i = Val(Text3.Text)
Ka = Val(Text4.Text)
If Option8.Value = True And Option5.Value = True And Option1.Value = True Then
Ka = 1
Text4.Text = Str(Ka)
End If
If Option8.Value = True And Option5.Value = True And Option2.Value = True Then
Ka = 1.1
End If
If Option8.Value = True And Option5.Value = True And Option3.Value = True Then
Ka = 1.2
End If
If Option8.Value = True And Option5.Value = True And Option4.Value = True Then
Ka = 1.3
End If
If Option8.Value = True And Option6.Value = True And Option1.Value = True Then
Ka = 1.1
End If
If Option8.Value = True And Option6.Value = True And Option2.Value = True Then
Ka = 1.2
End If
If Option8.Value = True And Option6.Value = True And Option3.Value = True Then
Ka = 1.3
End If
If Option8.Value = True And Option6.Value = True And Option4.Value = True Then
Ka = 1.4
End If
If Option1.Value = True And Option7.Value = True And Option1.Value = True Then
Ka = 1.2
End If
If Option8.Value = True And Option7.Value = True And Option2.Value = True Then
Ka = 1.3
End If
If Option8.Value = True And Option7.Value = True And Option3.Value = True Then
Ka = 1.4
End If
If Option8.Value = True And Option7.Value = True And Option4.Value = True Then
Ka = 1.5
End If
If Option9.Value = True And Option5.Value = True And Option1.Value = True Then
Ka = 1.1
End If
If Option9.Value = True And Option5.Value = True And Option2.Value = True Then
Ka = 1.2
End If
If Option9.Value = True And Option5.Value = True And Option3.Value = True Then
Ka = 1.4
End If
If Option9.Value = True And Option5.Value = True And Option4.Value = True Then
Ka = 1.5
End If
If Option9.Value = True And Option6.Value = True And Option1.Value = True Then
Ka = 1.2
End If
If Option9.Value = True And Option6.Value = True And Option2.Value = True Then
Ka = 1.3
End If
If Option9.Value = True And Option6.Value = True And Option3.Value = True Then
Ka = 1.5
End If
If Option2.Value = True And Option6.Value = True And Option4.Value = True Then
Ka = 1.6
End If
If Option9.Value = True And Option7.Value = True And Option1.Value = True Then
Ka = 1.3
End If
If Option9.Value = True And Option7.Value = True And Option2.Value = True Then
Ka = 1.4
End If
If Option9.Value = True And Option7.Value = True And Option3.Value = True Then
Ka = 1.6
End If
If Option9.Value = True And Option7.Value = True And Option4.Value = True Then
Ka = 1.8
End If
'Ka = Ka
Text4.Text = Ka
Pca = Ka * p
Text16.Text = Pca
End Sub
uj5u.com熱心網友回復:
朋友謝謝你。程式運行到If Option9.Value = True And Option5.Value = True And Option1.Value = True ThenKa = 1.1
End If
從Option9開始就不行了,另外text16計算功率任然不能顯示。
uj5u.com熱心網友回復:
我測驗的結果是可以的。你在我代碼基礎上改。你原來的代碼不要用了,太亂。轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/120520.html
標籤:非技術類
