Intersoft WebDesktop Documentation
How-to: Determine Effect programmatically based on current key state
See Also Send Feedback
Intersoft WebDesktop > WebDragDropExtender > Features > Keyboard State > How-to: Determine Effect programmatically based on current key state

Glossary Item Box

You can set effect programmatically based on current key state.

This topic will show you how to determine effect programmatically based on current key state.

To determine effect programmatically based on current key state

  1. Click on WebDragDropExtender instance and press F4.
  2. On ClientSide >> OnDragOver property, click the arrow icon and write DragOver.
  3. On HTML mode create a new client side function and named it function DragOver(controlId, e, dropObject). Here are the complete code :

    JavaScript Copy Code
    function DragOver(controlId, e, dropObject)
    {
        // provide the Effect based on key state during drag over
        if ((e.KeyState & ISKeyState.Ctrl) == ISKeyState.Ctrl)
            e.Effect = ISDragDropEffects.Copy;
        else if ((e.KeyState & ISKeyState.Alt) == ISKeyState.Alt)
            e.Effect = ISDragDropEffects.Link;
        else if ((e.KeyState & ISKeyState.Shift) == ISKeyState.Shift)
            e.Effect = ISDragDropEffects.Move;
        else
            e.Effect = ISDragDropEffects.None;
    }               
  4. Compile and run the project.

See Also

© 2012 Intersoft Solutions Corp. All Rights Reserved.