Forum Discussion

kandy1984's avatar
kandy1984
Contributor
9 years ago

scripting drag and drop in vbscript

Hi,

 

Im struggling to stimulate a drag and drop from one panel to another. Whatever i do, the destination doesnt go to the place that i need. It goes beyond the screen. I really hope someone will point out to me where im going wrong. Please see the screenshot. I need to drag LoadersAndTrucks panel to the dot on the grey area. The drag need to be relative to the grey area object and the grey area will always be ScreenLeft(202) and ScreenTop(98).

 

I hope someone will help me with the drag and drop method.

Thanks,

3 Replies

  • shankar_r's avatar
    shankar_r
    Community Hero

    Hi,

     

    Try the below code it should work,

     

    1. LoadersAndTrucks.Drag(LoadersAndTrucks.x, LoadersAndTrucks.y,((greyPanel.ScreenLeft + (greyPanel.Width / 2)) - LoadersAndTrucks.x), ((greyPanel.ScreenTop + (greyPanel.Height / 3)) - LoadersAndTrucks.y))
      Let me know your results.
    • kandy1984's avatar
      kandy1984
      Contributor

      Hi,

       

      Thank you very much for you reply Shankar. However, the code that you had provided dragged the LoadersAndTruck to the far bottom right panel, actually beyond the panel. The grey panel is really big 12000. Is there any other way that i can drag the LoadersAndTruck the way that i intent? Also the LoadersAndTrucks do not have a x or y but it has Bottom, Height, Left, Right, Top and Width as seen in the previous image.

       

      Thank you very much for helping me.

       

      Sudha.

    • kandy1984's avatar
      kandy1984
      Contributor

      Hi,

       

      Thank you very much for you reply Shankar. However, the code that you had provided dragged the LoadersAndTruck to the far bottom right panel, actually beyond the panel. The grey panel is really big 12000. Is there any other way that i can drag the LoadersAndTruck the way that i intent? Also the LoadersAndTrucks do not have a x or y but it has Bottom, Height, Left, Right, Top and Width as seen in the previous image.

       

      Thank you very much for helping me.

       

      Sudha.