Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting Drag
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01033566
Message ID:
01033627
Views:
19
>I want to select multiple objects on screen when the user drags the
>mouse over them.
>
>How do I do this?

Hi Kevin,

What exactly "the user drags the mouse over them" means?

Say, the user dragged the mouse drawing S - shaped line. There are multiple controls on the form. Do you want only the controls the mouse went over directly to be selected?
Or include any controls that are within the rectangle defined by the initial and final mouse positions?

For the first case you could use MouseMove() event, "probing" the underlying controls with SYS(1270), for example:
loTarget = SYS(1270) && Get the object under the mouse
cTarget = SYS(1272, loTarget) && get the object hierarchy for a specified object.
For the second case you could deternine the initial and final mouse positions and then write a routine that will check what controls on the form are withing that rectangle. In both cases the list/array of "selected" controls can be created and somehow processed later.

Both ways could be combined, depending on what you are going to achieve. Also, I assume you are dragging the mouse with Left or Right mouse button pressed.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform