在窗体上画一条直线,然后用鼠标点击窗体,直线变为曲线,用vb怎样写?谢谢。
1个回答
展开全部
给你个代码参考一下,
Const pi = 3.14159
Dim a
Private Sub Command1_Click()
Me.Width = 6000
Me.Height = 6000
Me.AutoRedraw = False
Me.ScaleMode = 3
Me.Scale (-10, 10)-(10, -10)
For a = -pi To pi Step pi / 60000
Me.PSet (a, Sqr(pi * pi - a * a)), vbBlue
Next
For a = pi To -pi Step -pi / 60000
Me.PSet (a, -Sqr(pi * pi - a * a)), vbBlue
Next
End Sub
Const pi = 3.14159
Dim a
Private Sub Command1_Click()
Me.Width = 6000
Me.Height = 6000
Me.AutoRedraw = False
Me.ScaleMode = 3
Me.Scale (-10, 10)-(10, -10)
For a = -pi To pi Step pi / 60000
Me.PSet (a, Sqr(pi * pi - a * a)), vbBlue
Next
For a = pi To -pi Step -pi / 60000
Me.PSet (a, -Sqr(pi * pi - a * a)), vbBlue
Next
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询