Intersoft WebDesktop Documentation
Walkthrough: Setting tooltip text programmatically in client side based on drop target objects.
See Also Send Feedback
Intersoft WebDesktop > WebDragDropExtender > Features > Vista Style Tooltip > Walkthrough: Setting tooltip text programmatically in client side based on drop target objects.

Glossary Item Box

This walkthrough shows you how to set tooltip text programmatically in client side based on drop target objects.

During this walkthrough, you will learn how to do the following:

 Prerequisites

In order to complete this walkthrough, you will need the following:

  • Visual Studio 2005 Application.

 Step-By-Step Instructions

To set tooltip text programmatically in client side based on drop target objects.

  1. Launch Visual Studio.NET 2005.
  2. Click on File menu, then select New and click Web Site.
  3. Select ASP.NET Web Site in the Template box and set Location to HTTP.
  4. Named the Web Site and click OK.
  5. Right-click on Project's name and select Add New Item.
  6. Select Intersoft AppForm in the My Templates box and named it as Walkthrough.aspx.
  7. Drag WebDragDropExtender instance from ToolBar to WebForm.
  8. Drag 3 ASP.Net panel to WebForm.
  9. Set the background of each panel to different color (e.g : first panel yellow, second panel blue and third panel red).



  10. Click on WebDragDropExtender instance and press F4.
  11. On DragControls property, click the (collection) button to open WebDragControl Collection Editor. You can set which panel will be the DragControl.



  12. On DropControls property, click the (collection) button to open WebDropControl Collection Editor. You can set which panel will be the DropControl.



  13. On ClientSide >> OnDragOver property, click the arrow icon and write DragOver.



  14. On HTML mode create a new client side function and named it function DragOver(controlId, e, dropObject). Here is the complete code :

    JavaScript Copy Code
    function DragOver(controlId, dragEventArgs, dropObject)
    {
       switch (dropObject.Owner.ControlID)
       {
           case "Panel3":
            dragEventArgs.Effect = ISDragDropEffects.Copy;
            dragEventArgs.EffectText = "Copy to " + dropObject.Owner.ControlID;
           break;
          
           case "Panel2":
            dragEventArgs.Effect = ISDragDropEffects.Remove;
            dragEventArgs.EffectText = "Remove this object";
           break;
        }
    }                         

  15. Run and compile the project.
  16. Try to hover the yellow panel to blue panel to see the tooltip.


See Also

© 2012 Intersoft Solutions Corp. All Rights Reserved.