程序语句.docx
- 文档编号:11300452
- 上传时间:2023-02-26
- 格式:DOCX
- 页数:22
- 大小:16.25KB
程序语句.docx
《程序语句.docx》由会员分享,可在线阅读,更多相关《程序语句.docx(22页珍藏版)》请在冰豆网上搜索。
程序语句
程序语句
Form1指令
PrivateSubFrame1_DragDrop()
EndSub
PrivateSubCommand1_Click()
LoadForm2
Form2.Show
UnloadForm1
EndSub
PrivateSubForm_Load()
EndSub
Form2指令
PrivateSubCommand1_Click()
X5=Chr(13)+Chr(10)
V=Val(Text1)
P=Val(Text2)
PR="输入转速"+Str(V)+X5+"传动功率"+Str(P)
Label4.Caption=PR
EndSub
PrivateSubCommand2_Click()
X5=Chr(13)+Chr(10)
V=Val(Text1)
P=Val(Text2)
LoadForm3
Form3.Show
Form2.Hide
EndSub
PrivateSubForm_Load()
X5=Chr(13)+Chr(10)
V=Val(Text1)
P=Val(Text2)
Label1.Caption="请输入已知参数"
Label2.Caption="输入转速"+X5+"请输入电动机的输入转速单位:
r/min"
Label3.Caption="传动功率"+X5+"请输入电动机功率单位:
KW"
EndSub
Form3指令
PrivateSubCommand1_Click()
X=Chr(13)+Chr(10)
I=Val(Text1)
IZ="传动比"+Str(I)+X+"齿轮齿数Z1"+Str(Z1)+X+"齿轮齿数Z2"+Str(Z2)
Label4.Caption=IZ
EndSub
PrivateSubCommand2_Click()
LoadForm4
Form4.Show
Form3.Hide
EndSub
PrivateSubCommand3_Click()
LoadForm2
Form2.Show
Form3.Hide
EndSub
PrivateSubForm_Load()
EndSub
PrivateSubText3_Click()
I=Val(Text1)
Z1=Val(Text2)
Z2=I*Z1
Text3=Str(Z2)
EndSub
Form4指令
PrivateSubCommand1_Click()
X=Chr(13)+Chr(10)
I=Val(Text1)
IZ="传动比"+Str(I)+X+"齿轮齿数Z1"+Str(Z1)+X+"齿轮齿数Z2"+Str(Z2)
Label4.Caption=IZ
EndSub
PrivateSubCommand2_Click()
LoadForm4
Form4.Show
Form3.Hide
EndSub
PrivateSubCommand3_Click()
LoadForm2
Form2.Show
Form3.Hide
EndSub
PrivateSubForm_Load()
EndSub
PrivateSubText3_Click()
I=Val(Text1)
Z1=Val(Text2)
Z2=I*Z1
Text3=Str(Z2)
EndSub
Form5指令
PrivateSubCombo1_click()
IfCombo1.ListIndex=0Then
Combo2.Clear
Combo2.List(0)="35"
Combo2.List
(1)="45"
Combo2.List
(2)="50"
EndIf
IfCombo1.ListIndex=1Then
Combo2.Clear
Combo2.List(0)="40Cr"
Combo2.List
(1)="35SiMn"
Combo2.List
(2)="40MnB"
Combo2.List(3)="20Gr"
Combo2.List(4)="MnTn1"
Combo2.List(5)="38GrMnAIA"
EndIf
IfCombo1.ListIndex=2Then
Combo2.Clear
Combo2.List(0)="ZG45"
Combo2.List
(1)="ZG55"
EndIf
IfCombo1.ListIndex=3Then
Combo2.Clear
Combo2.List(0)="HT300"
Combo2.List
(1)="HT350"
EndIf
IfCombo1.ListIndex=4Then
Combo2.Clear
Combo2.List(0)="QT600-3"
Combo2.List
(1)="QT700-2"
EndIf
IfCombo1.ListIndex=5Then
Combo2.Clear
Combo2.List(0)="夹布胶木"
EndIf
EndSub
PrivateSubCombo2_Click()
IfCombo2.Text="35"Then
Combo3.Clear
Combo3.List(0)="正火"
Combo3.List
(1)="调质"
EndIf
IfCombo2.Text="45"Then
Combo3.Clear
Combo3.List(0)="正火"
Combo3.List
(1)="调质"
Combo3.List
(2)="表面淬火"
EndIf
IfCombo2.Text="50"Then
Combo3.Clear
Combo3.List(0)="正火"
EndIf
IfCombo2.Text="40Gr"Then
Combo3.Clear
Combo3.List(0)="调质"
Combo3.List
(1)="表面淬火"
EndIf
IfCombo2.Text="35SiMn"Then
Combo3.Clear
Combo3.List(0)="调质"
Combo3.List
(1)="表面淬火"
EndIf
IfCombo2.Text="40MnB"Then
Combo3.Clear
Combo3.List(0)="调质"
Combo3.List
(1)="表面淬火"
EndIf
IfCombo2.Text="20Gr"Then
Combo3.Clear
Combo3.List(0)="渗碳淬火后回火"
EndIf
IfCombo2.Text="20GrMnTi"Then
Combo3.Clear
Combo3.List(0)="渗碳淬火后回火"
EndIf
IfCombo2.Text="38GrMnAIA"Then
Combo3.Clear
Combo3.List(0)="渗氮"
EndIf
IfCombo2.Text="ZG45"Then
Combo3.Clear
Combo3.List(0)="正火"
EndIf
IfCombo2.Text="ZG55"Then
Combo3.Clear
Combo3.List(0)="正火"
EndIf
IfCombo2.Text="HT300"Then
Combo3.Clear
Combo3.List(0)="不需热处理"
EndIf
IfCombo2.Text="HT350"Then
Combo3.Clear
Combo3.List(0)="不需热处理"
EndIf
IfCombo2.Text="QT600-3"Then
Combo3.Clear
Combo3.List(0)="不需热处理"
EndIf
IfCombo2.Text="QT700-3"Then
Combo3.Clear
Combo3.List(0)="不需热处理"
EndIf
IfCombo2.Text="夹布胶木"Then
Combo3.Clear
Combo3.List(0)="不需热处理"
EndIf
EndSub
PrivateSubCombo3_Click()
IfCombo2.Text="35"AndCombo3.ListIndex=0Then
Text3.Text="160"
EndIf
IfCombo2.Text="35"AndCombo3.ListIndex=1Then
Text3.Text="190"
EndIf
IfCombo2.Text="45"AndCombo3.ListIndex=0Then
Text3.Text="170"
EndIf
IfCombo2.Text="45"AndCombo3.ListIndex=1Then
Text3.Text="230"
EndIf
IfCombo2.Text="45"AndCombo3.ListIndex=2Then
Text3.Text="450"'表示方式不同
EndIf
IfCombo2.Text="50"AndCombo3.ListIndex=0Then
Text3.Text="180"
EndIf
IfCombo2.Text="40Gr"AndCombo3.ListIndex=0Then
Text3.Text="240"
EndIf
IfCombo2.Text="40Gr"AndCombo3.ListIndex=1Then
Text3.Text="500"'表示方式不同
EndIf
IfCombo2.Text="40MnB"AndCombo3.ListIndex=0Then
Text3.Text="250"
EndIf
IfCombo2.Text="40MnB"AndCombo3.ListIndex=1Then
Text3.Text="500"'表示方式不同
EndIf
IfCombo2.Text="20Gr"AndCombo3.ListIndex=0Then
Text3.Text="600"'表示方式不同
EndIf
IfCombo2.Text="20GrMnT"AndCombo3.ListIndex=0Then
Text3.Text="600"'表示方式不同
EndIf
IfCombo2.Text="35SiMn"AndCombo3.ListIndex=0Then
Text3.Text="220"
EndIf
IfCombo2.Text="35SiMn"AndCombo3.ListIndex=1Then
Text3.Text="500"'表示方式不同
EndIf
IfCombo2.Text="38GrMnAIA"AndCombo3.ListIndex=0Then
Text3.Text="850"'表示方式不同
EndIf
EndSub
PrivateSubCombo4_Click()
IfCombo4.ListIndex=0Then
Combo5.Clear
Combo5.List(0)="35"
Combo5.List
(1)="45"
Combo5.List
(2)="50"
EndIf
IfCombo4.ListIndex=1Then
Combo5.Clear
Combo5.List(0)="40Cr"
Combo5.List
(1)="35SiMn"
Combo5.List
(2)="40MnB"
Combo5.List(3)="20Gr"
Combo5.List(4)="MnTn1"
Combo5.List(5)="38GrMnAIA"
EndIf
IfCombo4.ListIndex=2Then
Combo5.Clear
Combo5.List(0)="ZG45"
Combo5.List
(1)="ZG55"
EndIf
IfCombo4.ListIndex=3Then
Combo5.Clear
Combo5.List(0)="HT300"
Combo5.List
(1)="HT350"
EndIf
IfCombo4.ListIndex=4Then
Combo5.Clear
Combo5.List(0)="QT600-3"
Combo5.List
(1)="QT700-2"
EndIf
IfCombo4.ListIndex=5Then
Combo5.Clear
Combo5.List(0)="夹布胶木"
EndIf
EndSub
PrivateSubCombo5_Click()
IfCombo5.Text="35"Then
Combo6.Clear
Combo6.List(0)="正火"
Combo6.List
(1)="调质"
EndIf
IfCombo5.Text="45"Then
Combo6.Clear
Combo6.List(0)="正火"
Combo6.List
(1)="调质"
Combo6.List
(2)="表面淬火"
EndIf
IfCombo5.Text="50"Then
Combo6.Clear
Combo6.List(0)="正火"
EndIf
IfCombo5.Text="40Gr"Then
Combo6.Clear
Combo6.List(0)="调质"
Combo6.List
(1)="表面淬火"
EndIf
IfCombo5.Text="35SiMn"Then
Combo6.Clear
Combo6.List(0)="调质"
Combo6.List
(1)="表面淬火"
EndIf
IfCombo5.Text="40MnB"Then
Combo6.Clear
Combo6.List(0)="调质"
Combo6.List
(1)="表面淬火"
EndIf
IfCombo5.Text="20Gr"Then
Combo6.Clear
Combo6.List(0)="渗碳淬火后回火"
EndIf
IfCombo5.Text="20GrMnTi"Then
Combo6.Clear
Combo6.List(0)="渗碳淬火后回火"
EndIf
IfCombo5.Text="38GrMnAIA"Then
Combo6.Clear
Combo6.List(0)="渗氮"
EndIf
IfCombo5.Text="ZG45"Then
Combo6.Clear
Combo6.List(0)="正火"
EndIf
IfCombo5.Text="ZG55"Then
Combo6.Clear
Combo6.List(0)="正火"
EndIf
IfCombo5.Text="HT300"Then
Combo6.Clear
Combo6.List(0)="不需热处理"
EndIf
IfCombo5.Text="HT350"Then
Combo6.Clear
Combo6.List(0)="不需热处理"
EndIf
IfCombo5.Text="QT600-3"Then
Combo6.Clear
Combo6.List(0)="不需热处理"
EndIf
IfCombo5.Text="QT700-3"Then
Combo6.Clear
Combo6.List(0)="不需热处理"
EndIf
IfCombo5.Text="夹布胶木"Then
Combo6.Clear
Combo6.List(0)="不需热处理"
EndIf
EndSub
PrivateSubCombo6_Click()
IfCombo5.Text="35"AndCombo6.ListIndex=0Then
Text6.Text="160"
EndIf
IfCombo5.Text="35"AndCombo6.ListIndex=1Then
Text6.Text="190"
EndIf
IfCombo5.Text="45"AndCombo6.ListIndex=0Then
Text6.Text="170"
EndIf
IfCombo5.Text="45"AndCombo6.ListIndex=1Then
Text6.Text="230"
EndIf
IfCombo5.Text="45"AndCombo6.ListIndex=2Then
Text6.Text="450"'表示方式不同
EndIf
IfCombo5.Text="50"AndCombo6.ListIndex=0Then
Text6.Text="180"
EndIf
IfCombo5.Text="40Gr"AndCombo6.ListIndex=0Then
Text6.Text="240"
EndIf
IfCombo5.Text="40Gr"AndCombo6.ListIndex=1Then
Text6.Text="500"'表示方式不同
EndIf
IfCombo5.Text="40MnB"AndCombo6.ListIndex=0Then
Text6.Text="250"
EndIf
IfCombo5.Text="40MnB"AndCombo6.ListIndex=1Then
Text6.Text="500"'表示方式不同
EndIf
IfCombo5.Text="20Gr"AndCombo6.ListIndex=0Then
Text6.Text="600"'表示方式不同
EndIf
IfCombo5.Text="20GrMnT"AndCombo6.ListIndex=0Then
Text6.Text="600"'表示方式不同
EndIf
IfCombo5.Text="35SiMn"AndCombo6.ListIndex=0Then
Text6.Text="220"
EndIf
IfCombo5.Text="35SiMn"AndCombo6.ListIndex=1Then
Text6.Text="500"'表示方式不同
EndIf
IfCombo5.Text="38GrMnAIA"AndCombo6.ListIndex=0Then
Text6.Text="850"'表示方式不同
EndIf
EndSub
PrivateSubCommand1_Click()
T1=Val(Text3)
T2=Val(Text6)
IfT1<350ThenText7.Text=1.1
IfT1<350ThenText8.Text=1.4
IfT1>350ThenText7.Text=1.2
IfT1>350ThenText8.Text=1.6
IfT2<350ThenText9.Text=1.1
IfT2<350ThenText10.Text=1.4
IfT2>350ThenText9.Text=1.2
IfT2>350ThenText10.Text=1.6
sh1=Val(Text7)
SF1=Val(Text8)
SH2=Val(Text9)
SF2=Val(Text10)
EndSub
PrivateSubCommand2_Click()
cl1=Combo1.Text&Combo2.Text&Combo3.Text
cl2=Combo4.Text&Combo5.Text&Combo6.Text
T1=Val(Text3)
T2=Val(Text6)
IfT1<350ThenText7.Text=1.1
IfT1<350ThenText8.Text=1.4
IfT1>350ThenText7.Text=1.2
IfT1>350ThenText8.Text=1.6
IfT2<350ThenText9.Text=1.1
IfT2<350ThenText10.Text=1.4
IfT2>350ThenText9.Text=1.2
IfT2>350ThenText10.Text=1.6
sh1=Val(Text7)
SF1=Val(Text8)
SH2=Val(Text9)
SF2=Val(Text10)
LoadForm9
Form9.Show
Form5.Hide
EndSub
PrivateSubForm_Load()
Combo1.List(0)="优质碳素钢"
Combo1.List
(1)="合金结构钢"
Combo1.List
(2)="铸钢"
Combo1.List(3)="灰铸铁"
Combo1.List(4)="球墨铸铁"
Combo1.List(5)="非金属"
Combo4.List(0)="优质碳素钢"
Combo4.List
(1)="合金结构钢"
Combo4.List
(2)="铸钢"
Combo4.List(3)="灰铸铁"
Combo4.List(4)="球墨铸铁"
Combo4.List(5)="非金属"
EndSub
Form6指
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 程序 语句