?? form1.frm
字號:
VERSION 5.00
Object = "Equation.3"; "EQNEDT32.EXE"
Begin VB.Form form1
Caption = "Form1"
ClientHeight = 5325
ClientLeft = 5325
ClientTop = 4185
ClientWidth = 5040
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 5325
ScaleWidth = 5040
Begin VB.Timer Timer1
Interval = 1
Left = 120
Top = 4320
End
Begin VB.CommandButton Command3
Caption = "關于"
Height = 375
Left = 3360
TabIndex = 6
Top = 4680
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "計算"
Height = 375
Left = 1920
TabIndex = 5
Top = 4680
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "重置"
Height = 375
Left = 600
TabIndex = 4
Top = 4680
Width = 975
End
Begin VB.Frame Frame2
Caption = "計算結果"
Height = 855
Left = 480
TabIndex = 10
Top = 3240
Width = 4095
Begin EquationCtl.Equation Equation1
CausesValidation= 0 'False
DragMode = 1 'Automatic
Height = 270
Left = 3120
OleObjectBlob = "Form1.frx":1272
TabIndex = 14
Top = 240
Width = 405
End
Begin VB.Label Label6
Alignment = 1 'Right Justify
BackColor = &H00404040&
Caption = "Label6"
BeginProperty Font
Name = "宋體"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFF00&
Height = 375
Left = 1440
TabIndex = 13
Top = 240
Width = 1575
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "雷擊等效面積:"
Height = 180
Left = 120
TabIndex = 11
Top = 360
Width = 1260
End
End
Begin VB.Frame Frame1
Caption = "輸入相關信息"
Height = 2295
Left = 480
TabIndex = 7
Top = 600
Width = 4095
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 3
Top = 1680
Width = 1575
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 2
Top = 960
Width = 1575
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1440
TabIndex = 1
Top = 405
Width = 1575
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "建筑物高H(m):"
Height = 180
Left = 120
TabIndex = 12
Top = 1800
Width = 1260
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "建筑物寬W(m):"
Height = 180
Left = 120
TabIndex = 9
Top = 1080
Width = 1260
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "建筑物長L(m):"
Height = 180
Left = 120
TabIndex = 8
Top = 480
Width = 1260
End
End
Begin VB.Label Label7
Alignment = 2 'Center
Caption = "Label7"
Height = 180
Left = 480
TabIndex = 15
Top = 4320
Width = 4095
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "建筑物等效面積計算"
BeginProperty Font
Name = "楷體_GB2312"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 285
Left = 1200
TabIndex = 0
Top = 120
Width = 2700
End
End
Attribute VB_Name = "form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim W As Double
Dim L As Double
Dim H As Double
Dim D As Double
Dim area As Double
Const PI = 3.1415926
Private Sub OLE1_Updated(Code As Integer)
End Sub
Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label6.Caption = ""
Label6.Visible = False
End Sub
Private Sub Command2_Click()
'L = CDbl(Text1.Text)
'W = CDbl(Text2.Text)
'H = CDbl(Text3.Text)
L = Val(Text1.Text)
W = Val(Text2.Text)
H = Val(Text3.Text)
If H < 100 And H > 0 Then
D = (H * (200 - H)) ^ (1 / 2)
area = (L * W + 2 * (L + W) * D + PI * (D ^ 2)) * (10 ^ (-6))
Label6.Caption = Format(area, "0.0000")
Label6.Visible = True
Equation1.Visible = True
ElseIf H >= 100 Then
area = (L * W + 2 * H * (L + W) + PI * (H ^ 2)) * (10 ^ (-6))
Label6.Caption = Format(area, "0.000")
Label6.Visible = True
ElseIf L = 0 Then
MsgBox "請輸入建筑物長度!", vbExclamation, "警告"
ElseIf W = 0 Then
MsgBox "請輸入建筑物寬度!", vbExclamation, "警告"
ElseIf H = 0 Then
MsgBox "請輸入建筑物高度!", vbExclamation, "警告"
Else
MsgBox "請輸入正確數據!", vbCritical, "錯誤"
End If
End Sub
Private Sub Command3_Click()
Dialog.Show
End Sub
Private Sub Form_Load()
form1.Caption = "雷擊等效面積" & Space(2) & "作者:謝明鑫"
Label6.Visible = False
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 And KeyAscii <> 46 And KeyAscii <> 8 Or KeyAscii > 57 Then
MsgBox "您輸入的類型不正確", vbExclamation, "警告"
KeyAscii = 0
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 And KeyAscii <> 46 And KeyAscii <> 8 Or KeyAscii > 57 Then
MsgBox "您輸入的類型不正確", vbExclamation, "警告"
KeyAscii = 0
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 And KeyAscii <> 46 And KeyAscii <> 8 Or KeyAscii > 57 Then
MsgBox "您輸入的類型不正確", vbExclamation, "警告"
KeyAscii = 0
End If
End Sub
Private Sub Timer1_Timer()
Label7.Caption = "當前時間:" & Now
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -