请哪位高手设计一VB程序,可以在一组文本框中输入的数据,单击按钮后将数据按饼状图或柱状图显示出来
展开全部
'给个参考。朋友。窗体上添加:三个文本框,一个命令按钮,一个图片框。
Private Sub Command1_Click()
Dim a(3) As Single
a(1) = Text1
a(2) = Text2
a(3) = Text3
Picture1.Scale (-5, 20)-(20, -5)
Picture1.Line (0, 0)-(20, 0)
Picture1.Line (0, 0)-(0, 20)
Picture1.Line (3, 0)-(5, a(1)), vbRed, BF
Picture1.CurrentX = 3: Picture1.CurrentY = a(1) + 2: Picture1.Print a(1)
Picture1.Line (7, 0)-(9, a(2)), vbRed, BF
Picture1.CurrentX = 7: Picture1.CurrentY = a(2) + 2: Picture1.Print a(2)
Picture1.Line (11, 0)-(13, a(3)), vbRed, BF
Picture1.CurrentX = 11: Picture1.CurrentY = a(3) + 2: Picture1.Print a(3)
End Sub
Private Sub Command1_Click()
Dim a(3) As Single
a(1) = Text1
a(2) = Text2
a(3) = Text3
Picture1.Scale (-5, 20)-(20, -5)
Picture1.Line (0, 0)-(20, 0)
Picture1.Line (0, 0)-(0, 20)
Picture1.Line (3, 0)-(5, a(1)), vbRed, BF
Picture1.CurrentX = 3: Picture1.CurrentY = a(1) + 2: Picture1.Print a(1)
Picture1.Line (7, 0)-(9, a(2)), vbRed, BF
Picture1.CurrentX = 7: Picture1.CurrentY = a(2) + 2: Picture1.Print a(2)
Picture1.Line (11, 0)-(13, a(3)), vbRed, BF
Picture1.CurrentX = 11: Picture1.CurrentY = a(3) + 2: Picture1.Print a(3)
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询