|
-
May 16th, 2005, 12:41 AM
#1
Thread Starter
New Member
need help in creating line and extending it.
Private Sub picFloorplan_DragDrop(Source As Control, X As Single, Y As Single)
Source.Move X, Y 'X - MouseX, Y - Mouse y
picFloorplan.Line (X, Y)-(X + 4000, Y), vbRed 'Drawing the first line (right)
picFloorplan.Line (X, Y)-(X - 4000, Y), vbRed 'Drawing the 2nd line (left)
picFloorplan.Line (X, Y)-(X, Y - 4000), vbYellow 'Drawing the vertical line (Up)
picFloorplan.Line (X, Y)-(X, Y + 4000), vbYellow 'Drawing the vertical line(down)
picFloorplan.Line (X, Y)-(X + 1500, Y - 1000), vbBlue 'Drawing the top right
picFloorplan.Line (X, Y)-(X + 1500, Y + 1000), vbBrown 'Drawing the bottom right
picFloorplan.Line (X, Y)-(X - 1500, Y - 1000), vbBrown 'Drawing the top left
picFloorplan.Line (X, Y)-(X - 1500, Y + 1000), vbBlue 'Drawing the bottom left
End Sub
This is my program
I need help in "drawing the top right Line", how do i extend the line while using the same coordinate.
Thank you.
-
May 16th, 2005, 01:56 PM
#2
Re: need help in creating line and extending it.
Welcome to the VB Forum
To which point do you want to exent that line?
Right now you draw it fro mthe mouse-position to the top rigth corner.
If you want to draw them as horizontal lines, you better use.
VB Code:
picFloorplan.Line (X, Y-1000)-(X + 1500, Y - 1000), vbBlue 'Drawing the top right
picFloorplan.Line (X, Y+1000)-(X + 1500, Y + 1000), vbBrown 'Drawing the bottom right
picFloorplan.Line (X, Y-1000)-(X - 1500, Y - 1000), vbBrown 'Drawing the top left
picFloorplan.Line (X, Y+1000)-(X - 1500, Y + 1000), vbBlue 'Drawing the bottom left
could you explain in more detail what you want?
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
-
May 29th, 2005, 08:30 PM
#3
Thread Starter
New Member
Re: need help in creating line and extending it.
i've solve the problem. thanks for the help anyway. but this there a way that i can extend these individual lines for it to reach the end of the corner of the picture box
-
May 30th, 2005, 01:32 PM
#4
Re: need help in creating line and extending it.
If I understood correctly, you want to draw lines from a Position within a Picturebox to the corners:
Here is an example which draws lines from the mouseposition (X,Y) to each corner
VB Code:
picFloorplan.Line (X, Y)-(0, 0), vbBlue 'Drawing to the top left corner
picFloorplan.Line (X, Y)-(picFloorplan.Width,0), vbBrown 'Drawing the top right corner
picFloorplan.Line (X, Y)-(0, picFloorplan.Height), vbBrown 'Drawing the bottom left corner
picFloorplan.Line (X, Y)-(picFloorplan.Width, picFloorplan.Height), vbBlue 'Drawing to the bottom right corner
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|