📄
字号:
VERSION 5.00
Begin VB.Form frmDraw
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "绘图"
ClientHeight = 6570
ClientLeft = 60
ClientTop = 345
ClientWidth = 7605
LinkTopic = "Form1"
ScaleHeight = 6570
ScaleWidth = 7605
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdExit
Caption = "退 出"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6240
TabIndex = 11
Top = 6000
Width = 1095
End
Begin VB.CommandButton cmdOK
Caption = "制 图"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5040
TabIndex = 10
Top = 6000
Width = 1095
End
Begin VB.PictureBox Picture6
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 2415
Left = 2640
ScaleHeight = 2385
ScaleWidth = 2265
TabIndex = 9
Top = 3480
Width = 2295
End
Begin VB.PictureBox Picture5
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 2415
Left = 240
ScaleHeight = 2385
ScaleWidth = 2145
TabIndex = 8
Top = 3480
Width = 2175
End
Begin VB.PictureBox Picture4
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 2415
Left = 5160
ScaleHeight = 2385
ScaleWidth = 2145
TabIndex = 7
Top = 480
Width = 2175
End
Begin VB.PictureBox Picture3
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 2415
Left = 2640
ScaleHeight = 2385
ScaleWidth = 2265
TabIndex = 6
Top = 480
Width = 2295
End
Begin VB.PictureBox Picture2
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 2415
Left = 240
ScaleHeight = 2385
ScaleWidth = 2145
TabIndex = 5
Top = 480
Width = 2175
End
Begin VB.Label Label6
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "正态分布"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 375
Left = 2640
TabIndex = 4
Top = 3120
Width = 2295
End
Begin VB.Label Label5
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "3次抛物线"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 375
Left = 240
TabIndex = 3
Top = 3120
Width = 2175
End
Begin VB.Label Label4
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "2次抛物线"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 375
Left = 5160
TabIndex = 2
Top = 120
Width = 2175
End
Begin VB.Label Label3
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "梯形分布"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 375
Left = 2520
TabIndex = 1
Top = 120
Width = 2295
End
Begin VB.Label Label2
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "矩形分布"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 375
Left = 240
TabIndex = 0
Top = 120
Width = 2175
End
End
Attribute VB_Name = "frmDraw"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'模糊分布图形窗体
Dim intI As Integer, intJ As Integer
Private Sub Form_Load()
'求元素的最小值和最大值
'自定义坐标系,左下角坐标为(sngMin,-0.1),右上角为(sngMax,1.1)
'Y轴从-0.1到1.1,X轴从sngMin到sngMax
Picture2.Scale (sngMin, 1.1)-(sngMax, -0.1)
Picture3.Scale (sngMin, 1.1)-(sngMax, -0.1)
Picture4.Scale (sngMin, 1.1)-(sngMax, -0.1)
Picture5.Scale (sngMin, 1.1)-(sngMax, -0.1)
Picture6.Scale (sngMin, 1.1)-(sngMax, -0.1)
'无边框
Picture2.BorderStyle = 0
Picture3.BorderStyle = 0: Picture4.BorderStyle = 0
Picture5.BorderStyle = 0: Picture6.BorderStyle = 0
Label2.Visible = False
Label3.Visible = False: Label4.Visible = False
Label5.Visible = False: Label6.Visible = False
End Sub
'作图
Private Sub cmdOk_Click()
Label2.Visible = True
Label3.Visible = True: Label4.Visible = True
Label5.Visible = True: Label6.Visible = True
'绘坐标线
Picture2.Line (sngMin, 0)-(sngMin, 1)
Picture2.Line (sngMin, 0)-(sngMax, 0)
Picture3.Line (sngMin, 0)-(sngMin, 1)
Picture3.Line (sngMin, 0)-(sngMax, 0)
Picture4.Line (sngMin, 0)-(sngMin, 1)
Picture4.Line (sngMin, 0)-(sngMax, 0)
Picture5.Line (sngMin, 0)-(sngMin, 1)
Picture5.Line (sngMin, 0)-(sngMax, 0)
Picture6.Line (sngMin, 0)-(sngMin, 1)
Picture6.Line (sngMin, 0)-(sngMax, 0)
'绘矩形分布
For intI = 1 To intN
sngX(intI) = sngR(intI, 1)
sngY(intI) = sngR(intI, 2)
Next intI
For intI = 1 To intN - 1
Picture2.Line (sngX(intI), sngY(intI))-(sngX(intI + 1), sngY(intI + 1))
Next intI
'绘梯形分布
For intI = 1 To intN
sngY(intI) = sngR(intI, 3)
Next intI
For intI = 1 To intN - 1
Picture3.Line (sngX(intI), sngY(intI))-(sngX(intI + 1), sngY(intI + 1))
Next intI
'绘2次抛物线
For intI = 1 To intN
sngY(intI) = sngR(intI, 4)
Next intI
For intI = 1 To intN - 1
Picture4.Line (sngX(intI), sngY(intI))-(sngX(intI + 1), sngY(intI + 1))
Next intI
'绘3次抛物线
For intI = 1 To intN
sngY(intI) = sngR(intI, 5)
Next intI
For intI = 1 To intN - 1
Picture5.Line (sngX(intI), sngY(intI))-(sngX(intI + 1), sngY(intI + 1))
Next intI
'绘正态分布
For intI = 1 To intN
sngY(intI) = sngR(intI, 6)
Next intI
For intI = 1 To intN - 1
Picture6.Line (sngX(intI), sngY(intI))-(sngX(intI + 1), sngY(intI + 1))
Next intI
End Sub
'退出
Private Sub cmdExit_Click()
Unload Me '卸载当前窗体
frmCalc.Visible = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -