Amar
as tyranid stated, the "sender" is the control that triggered the event. This control is never the control that started the drag and drop, but the control that accepted the drag.
Example:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_MouseDown(object sender, MouseEventArgs e)
{
this.DoDragDrop(this, DragDropEffects.Copy);
}
private void button2_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Copy;
}
private void button2_DragDrop(object sender, DragEventArgs e)
{
}
}
}
source
share