Results 1 to 2 of 2

Thread: Want last object dragged to be on top

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2001
    Posts
    18

    Want last object dragged to be on top

    VB Experts,

    I've finally learned how users at run time can click on objects and drag them around the form (while seeing the object being dragged, not an icon representing it).

    But I need the "latest object being moved" to always be shown ON TOP of the other objects. For example, the following arrayed objects ob1, ob2, ob3, ob4 and ob5 were copied onto the form in the following order: ob1 first to ob5 last.

    When ob1 is dragged around the form, ob1 will always slide UNDERNEITH ob2 through ob5. And when "dropped", ob1 will remain underneith ob2 through ob5.

    How is it possible to always have the last object moved always be on top of the others?

    Thank you,
    Jeff

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    When you initialize the drag (probably in the mousedown event) simply call the objects ZOrder.
    VB Code:
    1. obj1.ZOrder
    Best regards

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