Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drag Drop & Drag Controls Around
Message
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Miscellaneous
Thread ID:
01502580
Message ID:
01502591
Views:
33
>The button drags but does not remove. I'm not at all sure that this isthe way to do this. Can someone point me in the right direction?

You need to remove the button from the grid, it's not a child of the StackPanel. The StackPanel is the target you want to add it to.
Grid Name="OuterGrid"
   private void panel_Drop(object sender, DragEventArgs e)
      {
      StackPanel parent = (StackPanel)sender;
      Button button = (Button)e.Data.GetData(typeof(Button));
      Point p = e.GetPosition((IInputElement)this);
      OuterGrid.Children.Remove(button);
      parent.Children.Add(button);
      }
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform