主题:[讨论]找下各位大哥帮帮忙,谢谢
Dim flag As Boolean
Dim lx1 As Single, ly1 As Single
Private Sub form__load()
Top = 0
Left = 0
Width = 8000
Height = 8000
With Picture1
.Top = 1000
.Left = 0
.Width = 7800
.Height = 6500
End With
flag = False
Option1.Value = True
End Sub
Private Sub picture1_mousedown(button As Integer, shift As Integer, x As Single, y As Single)
flag = True
lx1 = x
ly1 = y
End Sub
Private Sub picture1_mousemove(button As Integer, shift As Integer, x As Single, y As Single)
If flag = True Then
picture2.AutoRedraw = True
Picture1.Line (0, 0)-(0, 0)
Picture1.AutoRedraw = False
Call draw(x, y)
End If
End Sub
Private Sub picture1_mouseup(button As Integer, shift As Integer, x As Single, y As Single)
flag = False
Picture1.AutoRedraw = True
Call draw(x, y)
End Sub
Sub draw(x As Single, y As Single)
Select Case True
Case Option1, Value:
Picture1.Line (lx1, ly1)-(x, y)
Case Option2.Value:
Picture1.Line (lx1, ly1)-(x, y), , B
Case Option2.Value:
r = Sqr((x - linex1) ^ 2 + (y - liney1) ^ 2)
Picture.Circle (lx1, ly1), r
End Select
End Sub
这个程序怎么出不了结果,也没提示出有什么错误。谢谢
Dim lx1 As Single, ly1 As Single
Private Sub form__load()
Top = 0
Left = 0
Width = 8000
Height = 8000
With Picture1
.Top = 1000
.Left = 0
.Width = 7800
.Height = 6500
End With
flag = False
Option1.Value = True
End Sub
Private Sub picture1_mousedown(button As Integer, shift As Integer, x As Single, y As Single)
flag = True
lx1 = x
ly1 = y
End Sub
Private Sub picture1_mousemove(button As Integer, shift As Integer, x As Single, y As Single)
If flag = True Then
picture2.AutoRedraw = True
Picture1.Line (0, 0)-(0, 0)
Picture1.AutoRedraw = False
Call draw(x, y)
End If
End Sub
Private Sub picture1_mouseup(button As Integer, shift As Integer, x As Single, y As Single)
flag = False
Picture1.AutoRedraw = True
Call draw(x, y)
End Sub
Sub draw(x As Single, y As Single)
Select Case True
Case Option1, Value:
Picture1.Line (lx1, ly1)-(x, y)
Case Option2.Value:
Picture1.Line (lx1, ly1)-(x, y), , B
Case Option2.Value:
r = Sqr((x - linex1) ^ 2 + (y - liney1) ^ 2)
Picture.Circle (lx1, ly1), r
End Select
End Sub
这个程序怎么出不了结果,也没提示出有什么错误。谢谢