Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[VB6問題]請問如何以兩點畫一個矩形?

0 views
Skip to first unread message

hchengta

unread,
May 11, 2001, 9:49:21 AM5/11/01
to
在form佈置一個option1,點選它時,則會以滑鼠按下決定矩形的一角,
滑鼠放開決定矩形的對角,藉此畫一矩形。
請問以下的程式碼有何錯誤?為何矩形只畫一半?
請來信告知,謝謝!

========================================================================================
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Option1.Value Then
CurrentX = X
CurrentY = Y
End If

End Sub
========================================================================================
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Option1.Value Then
Line (CurrentX, CurrentY)-(CurrentX, Y)
Line -(X, Y)
Line -(X, CurrentY)
Line -(CurrentX, CurrentY)
End If

End Sub
========================================================================================
--
※ Origin: 楓橋驛站<bbs.cs.nthu.edu.tw> ◆ From: h141.s233.ts31.hinet.net

VB 有問題嗎? 問我就對了!!!

unread,
May 11, 2001, 11:37:47 AM5/11/01
to
line 用法錯誤 直接將 form_mouseup 改成下面一行既可

Line (currentx, currenty)-(X, Y), 1, B

ps: 參數 b 改為 bf 為填滿


《 在 hcheng...@bbs.cs.nthu.edu.tw (hchengta) 的大作中提到: 》


--
[m [1;37m※ 來源:‧蛋捲廣場 bbs.tku.edu.tw‧[FROM: 163.30.120.155] [m

0 new messages