Control.Drag

Syntax

Drag: function (sender, args);

Parameters

sender. Event source.

args. Event information.

Description

The Drag event occurs on pressing and holding the left mouse button.

Example

To execute the example, connect the PP.js library and the table of the PP.css visual styles. See below the Javascript code which is used to locate a button on the HTML page.

<script type="text/javascript">
function Drag(data) {
    this.data = data;
    this.onDrag = function (sender, args)//Drag event handler
         {
             alert("onDrag")
         }
}
var D = new Drag("Drag event example");
var b1 = new PP.Ui.Button({
         Content: "Button",
         Drag: D.onDrag});
b1.addToNode("btn1");
</script>

After executing the example on pressing and holding the left mouse button the OnDrag message is displayed.

The event use is given using the example of the ListBox component and described in the Example of Creating the ListBox Component page.

See also:

Control