i want to implement a Drag/Drop mechanic in WPF, but it didn't work... With Windows-Forms it worked, ...
First i set AllowDrop to True. In windows-forms you can already drag items into the richtextbox and the cursor changes.
With WPF .... nothing happens.
The nexT point: Implement DragEnter and DragDrop Methodes. I did it like the online-manuals says. (ok i had to try out something more, because DragDrop doesn't exists in WPF) I think all tutorials for drag/drop is only for Windowsforms, nothing for WPF...
Is there a problem with the richtextbox? If i change it to "allowDrop" - nothing happens. The cursor is still a not-allowed-symbol.
Hope someone can help :)
Examplecode from tutorials i read:
richTextBox1.AllowDrop = true;
void richTextBox1_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.None;
if (e.Data.GetDataPresent(DataFormats.XXX))
{
e.Effect = DragDropEffects.Copy;
}
}
void richTextBox1_DragDrop(object sender, DragEventArgs e)
{
//intert in richtextbox ...
richTextBox1.methodeXY();
}