?? 正態分布圖f.frm
字號:
VERSION 5.00
Begin VB.Form frmNorm
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "正態分布"
ClientHeight = 2250
ClientLeft = 60
ClientTop = 450
ClientWidth = 4980
LinkTopic = "Form1"
ScaleHeight = 2250
ScaleWidth = 4980
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdNew
Caption = "重 作"
Height = 375
Left = 3960
TabIndex = 14
Top = 1680
Width = 735
End
Begin VB.CommandButton cmdExit
Caption = "退 出"
Height = 375
Left = 3120
TabIndex = 13
Top = 1680
Width = 735
End
Begin VB.CommandButton cmdCalculate
Caption = "計 算"
Height = 375
Left = 2280
TabIndex = 12
Top = 1680
Width = 735
End
Begin VB.TextBox Text5
Alignment = 2 'Center
Appearance = 0 'Flat
Height = 270
Left = 3120
TabIndex = 11
Top = 960
Width = 1215
End
Begin VB.TextBox Text4
Alignment = 2 'Center
Appearance = 0 'Flat
Height = 270
Left = 1560
TabIndex = 8
Top = 1680
Width = 615
End
Begin VB.TextBox Text3
Alignment = 2 'Center
Appearance = 0 'Flat
Height = 270
Left = 1560
TabIndex = 7
Top = 1320
Width = 615
End
Begin VB.TextBox Text2
Alignment = 2 'Center
Appearance = 0 'Flat
Height = 270
Left = 1560
TabIndex = 6
Top = 960
Width = 615
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Appearance = 0 'Flat
Height = 270
Left = 1560
TabIndex = 5
Top = 600
Width = 615
End
Begin VB.Label Label7
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "偏離點之間的概率"
ForeColor = &H80000008&
Height = 255
Left = 2520
TabIndex = 10
Top = 600
Width = 1935
End
Begin VB.Label Label6
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "計算結果"
ForeColor = &H80000008&
Height = 255
Left = 3000
TabIndex = 9
Top = 240
Width = 1455
End
Begin VB.Label Label5
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "偏離點2:"
ForeColor = &H80000008&
Height = 255
Left = 240
TabIndex = 4
Top = 1680
Width = 1215
End
Begin VB.Label Label4
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "偏離點1:"
ForeColor = &H80000008&
Height = 255
Left = 240
TabIndex = 3
Top = 1320
Width = 1215
End
Begin VB.Label Label3
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "標準差:"
ForeColor = &H80000008&
Height = 255
Left = 240
TabIndex = 2
Top = 960
Width = 1215
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "平均值:"
ForeColor = &H80000008&
Height = 255
Left = 240
TabIndex = 1
Top = 600
Width = 1215
End
Begin VB.Label Label1
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "輸入數據"
ForeColor = &H80000008&
Height = 255
Left = 360
TabIndex = 0
Top = 240
Width = 1815
End
End
Attribute VB_Name = "frmNorm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'計算
Private Sub cmdCalculate_Click()
Dim A As Double, B As Double
Dim C As Double, D As Double
Dim X1 As Double, X2 As Double
Dim p1 As Double, p2 As Double
A = Val(Text1.Text): B = Val(Text2.Text)
C = Val(Text3.Text): D = Val(Text4.Text)
X1 = (C - A) / B: X2 = (D - A) / B '標準化
Norm X1, p1 '求下側概率
Norm X2, p2 '求下側概率
'計算結果取小數點后兩位,第3位小數4舍5入
Text5.Text = Str((Int(Abs(p1 - p2) * 10000 + 0.5)) / 100) & "%"
End Sub
'退出
Private Sub cmdExit_Click()
Unload Me
End
End Sub
'重作
'清除文本框
Private Sub cmdNew_Click()
Dim ctlT As Control
On Error Resume Next
For Each ctlT In Controls
ctlT.Text = ""
Next
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -