T
Tony Johansson
Hi!
If I have this event handler pictureBox_DragEnter below and the statement
that couple the event to the eventhandler
panel1.DragEnter += new
System.Windows.Forms.DragEventHandler(this.pictureBox_DragEnter);
I wonder if there is an easy way to remove these two.
When I want to remove these two I follow this procedure today.
1. In the event property I click reset on the event that I want to remove.
2. I remove the event handler manually.
private void pictureBox_DragEnter(object sender, DragEventArgs e)
{
string filename;
if (((validData = GetFilename(out filename, e)) == true) &&
(e.Data.GetDataPresent(DataFormats.FileDrop)))
{
myImage = new Bitmap(filename);
e.Effect = DragDropEffects.Copy;
}
else
e.Effect = DragDropEffects.None;
}
this.panel1.DragEnter += new
System.Windows.Forms.DragEventHandler(this.pictureBox_DragEnter);
//Tony
If I have this event handler pictureBox_DragEnter below and the statement
that couple the event to the eventhandler
panel1.DragEnter += new
System.Windows.Forms.DragEventHandler(this.pictureBox_DragEnter);
I wonder if there is an easy way to remove these two.
When I want to remove these two I follow this procedure today.
1. In the event property I click reset on the event that I want to remove.
2. I remove the event handler manually.
private void pictureBox_DragEnter(object sender, DragEventArgs e)
{
string filename;
if (((validData = GetFilename(out filename, e)) == true) &&
(e.Data.GetDataPresent(DataFormats.FileDrop)))
{
myImage = new Bitmap(filename);
e.Effect = DragDropEffects.Copy;
}
else
e.Effect = DragDropEffects.None;
}
this.panel1.DragEnter += new
System.Windows.Forms.DragEventHandler(this.pictureBox_DragEnter);
//Tony