?? 描述統計f2.frm
字號:
VERSION 5.00
Begin VB.Form frmCalculate
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "描述統計數"
ClientHeight = 4890
ClientLeft = 165
ClientTop = 555
ClientWidth = 4890
LinkTopic = "Form1"
ScaleHeight = 8.625
ScaleMode = 7 'Centimeter
ScaleWidth = 8.625
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdExit
Caption = "退 出"
Height = 375
Left = 3360
TabIndex = 3
Top = 1560
Width = 1095
End
Begin VB.CommandButton cmdSave
Caption = "保 存"
Height = 375
Left = 3360
TabIndex = 2
Top = 1080
Width = 1095
End
Begin VB.CommandButton cmdPrint
Caption = "打 印"
Height = 375
Left = 3360
TabIndex = 1
Top = 600
Width = 1095
End
Begin VB.CommandButton cmdCalculate
Caption = "計 算"
Height = 375
Left = 3360
TabIndex = 0
Top = 120
Width = 1095
End
Begin VB.Label lblValue
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 375
Index = 9
Left = 1560
TabIndex = 23
Top = 4440
Width = 1575
End
Begin VB.Label lblValue
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 375
Index = 8
Left = 1560
TabIndex = 22
Top = 3960
Width = 1575
End
Begin VB.Label lblValue
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 375
Index = 7
Left = 1560
TabIndex = 21
Top = 3480
Width = 1575
End
Begin VB.Label lblValue
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 375
Index = 6
Left = 1560
TabIndex = 20
Top = 3000
Width = 1575
End
Begin VB.Label lblValue
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 375
Index = 5
Left = 1560
TabIndex = 19
Top = 2520
Width = 1575
End
Begin VB.Label lblValue
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 375
Index = 4
Left = 1560
TabIndex = 18
Top = 2040
Width = 1575
End
Begin VB.Label lblValue
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 375
Index = 3
Left = 1560
TabIndex = 17
Top = 1560
Width = 1575
End
Begin VB.Label lblValue
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 375
Index = 2
Left = 1560
TabIndex = 16
Top = 1080
Width = 1575
End
Begin VB.Label lblValue
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 375
Index = 1
Left = 1560
TabIndex = 15
Top = 600
Width = 1575
End
Begin VB.Label lblValue
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 375
Index = 0
Left = 1560
TabIndex = 14
Top = 120
Width = 1575
End
Begin VB.Label lblTitle
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "峰度系數:"
ForeColor = &H80000008&
Height = 375
Index = 9
Left = 120
TabIndex = 13
Top = 4440
Width = 1335
End
Begin VB.Label lblTitle
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "偏度系數:"
ForeColor = &H80000008&
Height = 375
Index = 8
Left = 120
TabIndex = 12
Top = 3960
Width = 1335
End
Begin VB.Label lblTitle
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "標準差:"
ForeColor = &H80000008&
Height = 375
Index = 7
Left = 120
TabIndex = 11
Top = 3480
Width = 1335
End
Begin VB.Label lblTitle
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "方差:"
ForeColor = &H80000008&
Height = 375
Index = 6
Left = 120
TabIndex = 10
Top = 3000
Width = 1335
End
Begin VB.Label lblTitle
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "平均差:"
ForeColor = &H80000008&
Height = 375
Index = 5
Left = 120
TabIndex = 9
Top = 2520
Width = 1335
End
Begin VB.Label lblTitle
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "范圍:"
ForeColor = &H80000008&
Height = 375
Index = 4
Left = 120
TabIndex = 8
Top = 2040
Width = 1335
End
Begin VB.Label lblTitle
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "幾何平均數:"
ForeColor = &H80000008&
Height = 375
Index = 3
Left = 120
TabIndex = 7
Top = 1560
Width = 1335
End
Begin VB.Label lblTitle
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "眾數:"
ForeColor = &H80000008&
Height = 375
Index = 2
Left = 120
TabIndex = 6
Top = 1080
Width = 1335
End
Begin VB.Label lblTitle
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "中位數:"
ForeColor = &H80000008&
Height = 375
Index = 1
Left = 120
TabIndex = 5
Top = 600
Width = 1335
End
Begin VB.Label lblTitle
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "算術平均數:"
ForeColor = &H80000008&
Height = 375
Index = 0
Left = 120
TabIndex = 4
Top = 120
Width = 1335
End
End
Attribute VB_Name = "frmCalculate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'計算窗體
Dim R(1 To 10) As Double, S(1 To 10) As Single, I As Integer
Dim strFileOut As String, intFileOut As Integer
Private Sub Form_Load()
cmdPrint.Visible = False '“打印”命令按鈕不可視
cmdSave.Visible = False '“保存”命令按鈕不可視
End Sub
'計算
Private Sub cmdCalculate_Click()
Character V, R '調用標準模塊中計算描述統計數的過程
'將計算結果放入標簽顯示
For I = 1 To 10
If R(I) < 90000000 Then
S(I) = R(I)
lblValue(I - 1).Caption = S(I)
Else
lblValue(I - 1).Caption = "無效"
End If
Next I
cmdPrint.Visible = True '“打印”命令按鈕可視
cmdSave.Visible = True '“保存”命令按鈕可視
End Sub
'打印
Private Sub cmdPrint_Click()
MsgBox "現在開始打印,請稍侯"
Printer.Print
With Printer
.FontName = "隸書"
.FontSize = 20
End With
Printer.Print Spc(8); "描述統計數"
With Printer
.FontName = "宋體"
.FontSize = 14
End With
For I = 1 To 10
Printer.Print Spc(8); lblTitle(I - 1).Caption, lblValue(I - 1).Caption
Next I
Printer.EndDoc
MsgBox "打印文檔已交付打印設備,請繼續其他工作"
End Sub
'保存
Private Sub cmdSave_Click()
strFileOut = frmFile.txtResult.Text '文件名
intFileOut = FreeFile '取得空閑的文件號碼
Open strFileOut For Output As intFileOut
Print #intFileOut, "描述統計數"
'將計算結果寫入文件
For I = 1 To 10
Print #intFileOut, lblTitle(I - 1).Caption; lblValue(I - 1).Caption
Next I
Close #intFileOut '關閉文件
End Sub
'退出
Private Sub cmdExit_Click()
Unload Me
End
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -