Click here to Skip to main content
15,901,001 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,I have ellipse in the window in wpf or any shape how can drag and drop it to the canvas in the window?
C++
private void ellipse_MouseMove(object sender, MouseEventArgs e)
{
    Ellipse ellipse = sender as Ellipse;
    if (ellipse != null && e.LeftButton == MouseButtonState.Pressed)
    {
        DragDrop.DoDragDrop( ellipse,
                             ellipse.Fill.ToString(),
                             DragDropEffects.Copy);
    }
}
Posted
Updated 8-Nov-14 2:28am
v2

1 solution

You've copied the code sample from MSDN document[^]. Was it a headache reading more from there? That was just the first page, continue reading more on MSDN you will learn drap and drop in WPF from there.

Since that code is not yours, you will not be able to understand any other code that we might share as a solution or suggestion. I will suggest, you keep reading those documents and trying out their code. MSDN codes are for examples and trial sort of stuff.
 
Share this answer
 
v2
Comments
[no name] 8-Nov-14 15:35pm    
+5.
Afzaal Ahmad Zeeshan 8-Nov-14 15:37pm    
Thanks Bruno.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900