Draging Images or Controls...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    Draging Images or Controls...

    Hi all,
    I have a small problem. How can i drag controls in a form?
    I want to do same as in explorer that we can drag any icon or folder anywhere in the window..

    Thanx
    >> ALI <<
  • lotus18
    Contributor
    • Nov 2007
    • 865

    #2
    Hi Ali

    What kind of control? How about Drag and Drop Method?

    Rey Sean

    Comment

    • Ali Rizwan
      Banned
      Contributor
      • Aug 2007
      • 931

      #3
      Originally posted by lotus18
      Hi Ali

      What kind of control? How about Drag and Drop Method?

      Rey Sean
      Thanx for replying.
      As you have experienced on your desktop that you can drag any icon any where on the desktop. I want to do same as that but with my image controls and label controls.

      Thanx
      >> ALI <<

      Comment

      • daniel aristidou
        Contributor
        • Aug 2007
        • 494

        #4
        Originally posted by Ali Rizwan
        Thanx for replying.
        As you have experienced on your desktop that you can drag any icon any where on the desktop. I want to do same as that but with my image controls and label controls.

        Thanx
        >> ALI <<
        hi ali....is this in vb6?

        Comment

        • jamesd0142
          Contributor
          • Sep 2007
          • 471

          #5
          Its messy but here what i did for something simular...

          to move a label:
          1. add a timer to your form (intervals 10)
          2. on the label mouse down event, start timer
          3. on the mouse up event stop timer.

          Timer code: (something like):
          label1.top = mouse position x
          label1.left = mouse position y

          I can remember exaclty how the code went, but im sure you get my idea?

          edit: i found this which should help Windows.Forms.C ursor.Position. Y (vb2005)

          James

          Comment

          • Ali Rizwan
            Banned
            Contributor
            • Aug 2007
            • 931

            #6
            Originally posted by daniel aristidou
            hi ali....is this in vb6?
            Yes this is in vb6.

            Thanx
            >> ALI <<

            Comment

            • Ali Rizwan
              Banned
              Contributor
              • Aug 2007
              • 931

              #7
              Originally posted by jamesd0142
              Its messy but here what i did for something simular...

              to move a label:
              1. add a timer to your form (intervals 10)
              2. on the label mouse down event, start timer
              3. on the mouse up event stop timer.

              Timer code: (something like):
              label1.top = mouse position x
              label1.left = mouse position y

              I can remember exaclty how the code went, but im sure you get my idea?

              edit: i found this which should help Windows.Forms.C ursor.Position. Y (vb2005)

              James
              Ok
              By the way i have made my code for dragging. That was not different than yours but in vb6 nstead of mouse position.... i write x and y only.

              Thanx
              >> ALI <<

              Comment

              Working...