📄 form1.frm
字号:
End
Begin VB.Label Label13
BackColor = &H00C0FFFF&
Caption = "KN"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3000
TabIndex = 6
Top = 240
Width = 375
End
Begin VB.Label Label12
BackColor = &H00C0FFFF&
Caption = "大小:"
Height = 255
Left = 360
TabIndex = 4
Top = 240
Width = 615
End
End
Begin VB.Label Label30
BackColor = &H00C0FFFF&
Caption = "支座形式"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 46
Top = 6600
Width = 1335
End
Begin VB.Label Label10
BackColor = &H00C0FFFF&
Caption = "受力信息"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 2
Top = 2280
Width = 1215
End
Begin VB.Label Label2
BackColor = &H00C0FFFF&
Caption = "几何尺寸(矩形截面)"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 0
TabIndex = 1
Top = 960
Width = 1695
End
Begin VB.Label Label1
Alignment = 2 'Center
BackColor = &H00C0FFFF&
Caption = "欢迎使用单跨梁简易计算软件"
BeginProperty Font
Name = "隶书"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2280
TabIndex = 0
Top = 240
Width = 6855
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If dimes.l <> 0 And dimes.b <> 0 And dimes.h <> 0 Then
Command2.Enabled = True
MsgBox "梁几何参数已输入,未输入的载荷参数,则均按0计,请点击“确定”", vbOKOnly + vbDefaultButton1 + vbInformation, "通知"
Else: MsgBox "请输入梁几何参数", vbOKOnly + vbExclamation + vbDefaultButton1, "警告"
End If
End Sub
Private Sub Command2_Click()
Load Form2
Form2.Show
Unload Form1
End Sub
Private Sub Form_Load()
t_p = 1 '将所有载荷和载荷数初始化为0
i_p = 1
lp(1).ud = True
t_m = 1
i_m = 1
lm(1).ud = True
lq.ud = True
E = Text13.Text
dimes.l = Text1.Text
dimes.h = Text2.Text
dimes.b = Text3.Text
lp(1).p = Text4.Text
lp(1).xp = Text6.Text
lq.q = Text5.Text
lm(1).m = Text7.Text
lm(1).xm = Text8.Text
Command2.Enabled = False '将“确定”按纽初始化为不可用
ls.fs = True '左边界条件初始化为全自由支持
ls.gs = False
ls.tg = False
ls.ts = False
ls.z = False
rs.fs = True '右边界条件初始化为全自由支持
rs.gs = False
rs.tg = False
rs.ts = False
rs.z = False
End Sub
Private Sub Option1_Click()
lp(i_p).ud = False
End Sub
Private Sub Option11_Click()
ls.fs = False '左边界条件为固定支持
ls.gs = True
ls.tg = False
ls.ts = False
ls.z = False
End Sub
Private Sub Option13_Click()
ls.fs = False '左边界条件为自由端
ls.gs = False
ls.tg = False
ls.ts = False
ls.z = True
End Sub
Private Sub Option14_Click()
rs.fs = True '右边界条件为自由支持
rs.gs = False
rs.tg = False
rs.ts = False
rs.z = False
End Sub
Private Sub Option15_Click()
rs.fs = False '右边界条件为固定支持
rs.gs = True
rs.tg = False
rs.ts = False
rs.z = False
End Sub
Private Sub Option16_Click()
rs.fs = False '右边界条件为自由端
rs.gs = False
rs.tg = False
rs.ts = False
rs.z = True
End Sub
Private Sub Option19_Click() '“检查”按纽
End Sub
Private Sub Option2_Click()
lp(i_p).ud = True
End Sub
Private Sub Option3_Click()
lq.ud = False
End Sub
Private Sub Option4_Click()
lq.ud = True
End Sub
Private Sub Option5_Click()
lm(i_m).ud = True
End Sub
Private Sub Option6_Click()
lm(i_m).ud = False
End Sub
Private Sub Option7_Click()
If Text4.Text <> "" And Text6.Text <> "" Then
t_p = i_p
i_p = i_p + 1
Text4.Text = 0
Text6.Text = 0
lp(i_p).ud = True
Else: MsgBox "请在当前输入", vbOKOnly + vbExclamation + vbDefaultButton1, "警告!"
End If
End Sub
Private Sub Option8_Click()
If Text7.Text <> "" And Text8.Text <> "" Then
t_m = i_m
i_m = i_m + 1
Text7.Text = 0
Text8.Text = 0
lm(i_m).ud = True
Else: MsgBox "请在当前输入", vbOKOnly + vbExclamation + vbDefaultButton1, "警告!"
End If
End Sub
Private Sub Option9_Click()
ls.fs = True '左边界条件为自由支持
ls.gs = False
ls.tg = False
ls.ts = False
ls.z = False
End Sub
Private Sub Text1_LostFocus()
If Text1.Text = "" Then
Text1.Text = 0
Exit Sub
End If
dotnum = 0
For i = 1 To Len(Text1.Text)
strtemp = Mid(Text1.Text, i, 1)
If strtemp = "." Then
dotnum = dotnum + 1
End If
If (Asc(strtemp) >= Asc(0) And Asc(strtemp) <= Asc(9)) Or (strtemp = "." And dotnum = 1) Then
Else: MsgBox "请输入数值型字符,并且只能有一个小数点", vbOKOnly + vbExclamation + vbDefaultButton1, "警告"
Exit Sub
End If
Next
dimes.l = Text1.Text
End Sub
Private Sub Text13_LostFocus()
If Text13.Text = "" Then
Text13.Text = 0
End If
dotnum = 0
For i = 1 To Len(Text13.Text)
strtemp = Mid(Text13.Text, i, 1)
If strtemp = "." Then
dotnum = dotnum + 1
End If
If (Asc(strtemp) >= Asc(0) And Asc(strtemp) <= Asc(9)) Or (strtemp = "." And dotnum = 1) Then
Else: MsgBox "请输入数值型字符,并且只能有一个小数点", vbOKOnly + vbExclamation + vbDefaultButton1, "警告"
Exit Sub
End If
Next
E = Text13.Text
End Sub
Private Sub Text2_LostFocus()
If Text2.Text = "" Then
Text2.Text = 0
End If
dotnum = 0
For i = 1 To Len(Text2.Text)
strtemp = Mid(Text2.Text, i, 1)
If strtemp = "." Then
dotnum = dotnum + 1
End If
If (Asc(strtemp) >= Asc(0) And Asc(strtemp) <= Asc(9)) Or (strtemp = "." And dotnum = 1) Then
Else: MsgBox "请输入数值型字符,并且只能有一个小数点", vbOKOnly + vbExclamation + vbDefaultButton1, "警告"
Exit Sub
End If
Next
dimes.h = Text2.Text
End Sub
Private Sub Text3_LostFocus()
If Text3.Text = "" Then
Text3.Text = 0
End If
dotnum = 0
For i = 1 To Len(Text3.Text)
strtemp = Mid(Text3.Text, i, 1)
If strtemp = "." Then
dotnum = dotnum + 1
End If
If (Asc(strtemp) >= Asc(0) And Asc(strtemp) <= Asc(9)) Or (strtemp = "." And dotnum = 1) Then
Else: MsgBox "请输入数值型字符,并且只能有一个小数点", vbOKOnly + vbExclamation + vbDefaultButton1, "警告"
Exit Sub
End If
Next
dimes.b = Text3.Text
End Sub
Private Sub Text4_LostFocus()
If Text4.Text = "" Then
Text4.Text = 0
End If
dotnum = 0
For i = 1 To Len(Text4.Text)
strtemp = Mid(Text4.Text, i, 1)
If strtemp = "." Then
dotnum = dotnum + 1
End If
If (Asc(strtemp) >= Asc(0) And Asc(strtemp) <= Asc(9)) Or (strtemp = "." And dotnum = 1) Then
Else: MsgBox "请输入数值型字符,并且只能有一个小数点", vbOKOnly + vbExclamation + vbDefaultButton1, "警告"
Exit Sub
End If
Next
lp(i_p).p = Text4.Text
End Sub
Private Sub Text5_LostFocus()
If Text5.Text = "" Then
Text5.Text = 0
End If
dotnum = 0
For i = 1 To Len(Text5.Text)
strtemp = Mid(Text5.Text, i, 1)
If strtemp = "." Then
dotnum = dotnum + 1
End If
If (Asc(strtemp) >= Asc(0) And Asc(strtemp) <= Asc(9)) Or (strtemp = "." And dotnum = 1) Then
Else: MsgBox "请输入数值型字符,并且只能有一个小数点", vbOKOnly + vbExclamation + vbDefaultButton1, "警告"
Exit Sub
End If
Next
lq.q = Text5.Text
End Sub
Private Sub Text6_LostFocus()
If Text6.Text = "" Then
Text6.Text = 0
End If
dotnum = 0
For i = 1 To Len(Text6.Text)
strtemp = Mid(Text6.Text, i, 1)
If strtemp = "." Then
dotnum = dotnum + 1
End If
If (Asc(strtemp) >= Asc(0) And Asc(strtemp) <= Asc(9)) Or (strtemp = "." And dotnum = 1) Then
Else: MsgBox "请输入数值型字符,并且只能有一个小数点", vbOKOnly + vbExclamation + vbDefaultButton1, "警告"
Exit Sub
End If
Next
lp(i_p).xp = Text6.Text
End Sub
Private Sub Text7_LostFocus()
If Text7.Text = "" Then
Text7.Text = 0
End If
dotnum = 0
For i = 1 To Len(Text7.Text)
strtemp = Mid(Text7.Text, i, 1)
If strtemp = "." Then
dotnum = dotnum + 1
End If
If (Asc(strtemp) >= Asc(0) And Asc(strtemp) <= Asc(9)) Or (strtemp = "." And dotnum = 1) Then
Else: MsgBox "请输入数值型字符,并且只能有一个小数点", vbOKOnly + vbExclamation + vbDefaultButton1, "警告"
Exit Sub
End If
Next
lm(i_m).m = Text7.Text
End Sub
Private Sub Text8_LostFocus()
If Text8.Text = "" Then
Text8.Text = 0
End If
dotnum = 0
For i = 1 To Len(Text8.Text)
strtemp = Mid(Text8.Text, i, 1)
If strtemp = "." Then
dotnum = dotnum + 1
End If
If (Asc(strtemp) >= Asc(0) And Asc(strtemp) <= Asc(9)) Or (strtemp = "." And dotnum = 1) Then
Else: MsgBox "请输入数值型字符,并且只能有一个小数点", vbOKOnly + vbExclamation + vbDefaultButton1, "警告"
Exit Sub
End If
Next
lm(i_m).xm = Text8.Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -