7,759
社区成员
发帖
与我相关
我的任务
分享
Private Sub Command2_Click()
Dim i As Integer, it As Integer, s As Integer, m As Integer, d As Integer, ii As Integer, g As Integer
Picture1.AutoRedraw = True
Picture1.Scale (0, 0)-(100, 30)
For it = 1 To MSFlexGrid1.Rows - 3
s = MSFlexGrid1.TextMatrix(it, 5)
m = MSFlexGrid1.TextMatrix(it + 1, 5)
g = MSFlexGrid1.TextMatrix(it + 2, 5)
Picture1.Line (it, Val(s))-(it + 1, Val(m))
Picture1.Print Val(g)
Next
End Sub
Private Sub Form_Click()
Dim I, OldFontSize ' 声明变量。
Width = 8640: Height = 5760 ' 按缇设置窗体大小。
Move 100, 100 ' 移动窗体起点。
AutoRedraw = -1 ' 打开AutoRedraw。
OldFontSize = FontSize ' 保持旧的字体大小。
BackColor = QBColor(7) ' 将背景设置为灰色。
Scale (0, 110)-(130, 0) ' 设定自定义座标系统。
For I = 100 To 10 Step -10
Line (0, I)-(2, I) ' 每隔 10 个单位划尺寸标记。
CurrentY = CurrentY + 1.5 ' 移动光标位置。
Print I ' Print scale mark value on left.
Line (ScaleWidth - 2, I)-(ScaleWidth, I)
CurrentY = CurrentY + 1.5 ' 移动光标位置。
CurrentX = ScaleWidth - 9
Print I ' 将尺寸标记值打印在右边。
Next I
' 画条形图。
Line (10, 0)-(20, 45), RGB(0, 0, 255), BF ' 第一个蓝色条。
Line (20, 0)-(30, 55), RGB(255, 0, 0), BF ' 第一个红色条。
Line (40, 0)-(50, 40), RGB(0, 0, 255), BF
Line (50, 0)-(60, 25), RGB(255, 0, 0), BF
Line (70, 0)-(80, 35), RGB(0, 0, 255), BF
Line (80, 0)-(90, 60), RGB(255, 0, 0), BF
Line (100, 0)-(110, 75), RGB(0, 0, 255), BF
Line (110, 0)-(120, 90), RGB(255, 0, 0), BF
CurrentX = 18: CurrentY = 100 ' 移动光标位置。
FontSize = 14 ' 放大标题尺寸。
Print "Widget Quarterly Sales" ' 打印标题。
FontSize = OldFontSize ' 还原字体大小。
CurrentX = 27: CurrentY = 93 ' 移动光标位置。
Print "Planned Vs. Actual" ' 打印子标题。
Line (29, 86)-(34, 88), RGB(0, 0, 255), BF ' 打印图例。
Line (43, 86)-(49, 88), RGB(255, 0, 0), BF
End Sub