Ever get the idea that someone at Microsoft is just taking the piss?
I simply wanted to drag a row from a DataGridView onto a Trash Can picture and delete the row.
All the coding had already been done to delete the row so I expected to take 5 minutes knocking up the rest of it.
The PictureBox has DragEnter and DragDrop Event handlers so writing that bit was easy:
private void picDelete_DragDrop(object sender, DragEventArgs e)
{
deleteRow();
}
private void picDelete_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Move;
}
However a PictureBox doesn't have an AllowDrop property listed in the design time properties. Without this being set to true the Drag events will not be invoked and so the coding above will do nothing.
After a bit of searching I found some code where this was set at run time.
picDelete.AllowDrop = true;
However this property does not appear to exist when you enter the above code.
In spite of this it does actually compile and run successfully and now my PictureBox does exactly what I want.
Any logic in having hidden properties like this?