📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "形象的动态三维饼图"
ClientHeight = 3270
ClientLeft = 3060
ClientTop = 1725
ClientWidth = 5280
ForeColor = &H00FF0000&
LinkTopic = "Form1"
ScaleHeight = 3270
ScaleWidth = 5280
Begin VB.CommandButton Command1
Caption = "开始"
Height = 405
Left = 120
TabIndex = 1
Top = 120
Width = 1125
End
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
AutoSize = -1 'True
FillColor = &H000000C0&
Height = 3030
Left = 1335
ScaleHeight = 2970
ScaleWidth = 3780
TabIndex = 0
Top = 150
Width = 3840
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()
Dim PI, circStart, circEnd, gPercent, jPercent, nX, nY, rad
nX = Picture1.ScaleWidth \ 2
nY = Picture1.ScaleHeight \ 2
rad = 1000
gPercent = 75
jPercent = 25
PI = 22 / 7
circStart = (gPercent * PI) / 180
circEnd = (jPercent * PI) / 180
Picture1.DrawWidth = 1
Picture1.FillStyle = 0
Picture1.FillColor = vbBlue
'The For - Next is not nested for clarity
For i = 1 To 200
Picture1.Circle (nX, nY), rad, vbRed, -circStart, -circEnd, -1
nX = nX + 1
nY = nY + 1
Next i
Picture1.FillColor = vbRed
For j = 1 To 200
'Adjusting the nX and nY moves the wedge
Picture1.Circle (nX + 200, nY - 500), rad, vbBlue, -circEnd, -circStart, -1
nX = nX + 1
nY = nY + 1
Next j
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -