Results 1 to 5 of 5

Thread: lines as objects

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485

    Post

    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.

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485

    Post

    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.

  4. #4
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

    Post

    Maybe you can use a usercontrol and drop the lines on that.

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width