ZennoLab Assemblies Documentation
DragAndDrop Method
Example 

Type: System.Int32

The handle of the window.

Type: System.Int32

The x coordinate in the window for drag event.

Type: System.Int32

The y coordinate in the window for drag event.

Type: System.Int32

The x coordinate in the window for drop event.

Type: System.Int32

The y coordinate in the window for drop event.

Performs the drag and drop events inside specified window by handle.
Syntax
public static string DragAndDrop( 
   int handle,
   int fromX,
   int formY,
   int toX,
   int toY
)

Parameters

handle

Type: System.Int32

The handle of the window.

fromX

Type: System.Int32

The x coordinate in the window for drag event.

formY

Type: System.Int32

The y coordinate in the window for drag event.

toX

Type: System.Int32

The x coordinate in the window for drop event.

toY

Type: System.Int32

The y coordinate in the window for drop event.

Return Value

Type: System.String

The answer with information about the success of the current command's execution. If current command was successful then this answer is "ok"; otherwise message describing the error.

Example
The following code example demonstrates uses of the DragAndDrop method. This code just navigate to some page and perform the drag and drop events in specified coordinates.
// go to page with drag and drop element
if (instance.ActiveTab.IsNull || instance.ActiveTab.IsVoid) return "Fail";
instance.ActiveTab.Navigate("dragdroppage.com");
// wait downloading
if (instance.ActiveTab.IsBusy) instance.ActiveTab.WaitDownloading();
 
// do drag and drop event
return Emulator.DragAndDrop(instance.ActiveTab.Handle, 100, 100, 200);
// go to page with drag and drop element
if ($instance->ActiveTab->IsNull || $instance->ActiveTab->IsVoid) return "Fail";
$instance->ActiveTab->Navigate("dragdroppage.com");
// wait downloading
if ($instance->ActiveTab->IsBusy) $instance->ActiveTab->WaitDownloading();
 
// do drag and drop event
return ZennoLab\Emulation\Emulator::DragAndDrop($instance->ActiveTab->Handle, 100, 100, 200);
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

Emulator Class
Emulator Members

Send Feedback