大家好 我做了個小畫家的VB程式 可是執行一直出現錯誤
想請會的大大說明一下 並修正錯誤和解釋
謝謝!
網址是我的VB程式
http:/home.so-net.net.tw/84603638/vb.rar
2006-06-19 21:03:47 · 2 個解答 · 發問者 喵喵 2 in 電腦與網際網路 ➔ 程式設計
Dim x1 As Integer, y1 As Integer
Dim x2 As Integer, y2 As Integer
Dim Tool As Integer
Private Sub Ellispe(ByVal x1 As Integer, ByVal y1 As Integer, ByVal x2 As Integer, ByVal y2 As Integer)
Dim t As Integer
Dim r As Single, rx As Single, ry As Single
If x1 > x2 Then
t = x1
x1 = x2
End If
If y1 > y2 Then
t = y1
y1 = y2
y2 = t
End If
rx = (x2 - x1 + 1) / 2
ry = (y2 - y1 + 1) / 2
If rx > ry Then r = rx Else r = ry
PicDraw.Circle (x1 + rx, y1 + ry), r, , , , ry / rx
End Sub
Private Sub Draw(ByVal x1 As Integer, ByVal y1 As Integer, ByVal x2 As Integer, ByVal y2 As Integer)
Select Case Tool
Case 1
PicDraw.Line (x1, y1)-(x2, y2)
Case 2
PicDraw.Line (x1, y1)-(x2, y2), , B
Case 3
Ellispe x1, y1, x2, y2
End Select
End Sub
Private Sub optTool_Click(Index As Integer)
Tool = Index
End Sub
Private Sub picDraw_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
If Tool <> 0 Then
PicDraw.DrawMode = 6
Draw X, Y, X, Y
x1 = X
x2 = X
y1 = Y
y2 = Y
Else
PicDraw.PSet (X, Y)
End If
End If
End Sub
Private Sub picDraw_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
If Tool <> 0 Then
Draw x1, y1, x2, y2
x2 = X
y2 = Y
Draw x1, y1, x2, y2
Else
PicDraw.Line -(X, Y)
End If
End If
End Sub
Private Sub PicDraw_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
If Tool <> 0 Then
Draw x1, y1, x2, y2
x2 = X
y2 = Y
PicDraw.DrawMode = 13
Draw x1, y1, x2, y2
End If
End If
End Sub
Private Sub CmdEnd_Click()
End
End Sub
注意一下你的變數定義 Integer,其中第一個英文字母是 I 不是 L ,你在程式裡面都打L ( l ) !!
另外最下面多了一個 End sub 把它砍了!!
你的離開沒有功能我幫你加上去嚕^^!!!
2006-06-20 09:13:44 · answer #1 · answered by Angus 5 · 0⤊ 0⤋
恩....小弟只能深深的佩服你....字可以全部都打錯...是看者書打嗎...?
不是lnteger 是integer 是 i I 喔,不是L
還有最後面多了一個end sub
這樣應該就可以了
2006-06-19 21:20:19 · answer #2 · answered by ? 4 · 0⤊ 0⤋