PDA

Click to See Complete Forum and Search --> : lines as objects


joey o.
Nov 27th, 1999, 01:12 AM
How do I create a line as an object on a form that can be selected and moved by the user during runtime? The line control doesn't support this and I can't find anything more about the line method other than it's size and color.
Thanks in advance.

MartinLiss
Nov 27th, 1999, 01:32 AM
I don't believe that you can have the user select it, but you can move it by changing its X1, X2, Y1 and Y2 properties.

joey o.
Nov 27th, 1999, 05:29 AM
Thanks for trying Martin but I can't give up. If the answer isn't readily available maybe someone could suggest a source that might teach me to build it?
Thanks again. :)

Crazy D
Nov 27th, 1999, 06:28 PM
Maybe you can use a usercontrol and drop the lines on that.

MartinLiss
Nov 28th, 1999, 12:29 AM
Try this:

Place a Picturebox on your form. Its width should be the width that you want your line to be, its Appearance should be flat, its BorderStyle should be 0, its DragMode should be 1, and its BackColor should be the same as the BackColor of your form. Draw a line within the picturebox. Reduce the height of the picturebox to 60, and change the Y1 and Y2 properties of the line to 30. (I assume the line is horizontal) Add this code to your form’s DragDrop event Source.Move (X - Source.Width / 2), (Y - Source.Height / 2)


------------------
Marty