ZennoLab Assemblies Documentation
DragAndDrop Method
See Also  Example Send Feedback
ZennoLab.Emulation Assembly > ZennoLab.Emulation Namespace > Emulator Class : DragAndDrop Method
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.

Glossary Item Box

Performs the drag and drop events inside specified window by handle.

Syntax

C# 
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.
C#Copy Code
// 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);
PHPCopy Code
// 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: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.