Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Drag Drop & Drag Controls Around
Message
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Divers
Thread ID:
01502580
Message ID:
01502591
Vues:
34
>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);
      }
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform