c# - Issue with D&D from list box to the screen -
i'm using following code drag & drop listbox
textbox
working great, got problem. when drag item listbox
, mistake drop screen, not in textbox
. cant take item drag screen , noting. need pick new item list , drag textbox
, can drag again. there way to check if item drag drop in textbox?
this code use , calling dodragdrop
method. if drag wrong place in screen (not textbox), idea?
private void listbox_selectionchanged(object sender, routedeventargs routedeventargs) { if (sender listbox) { var listbox = sender listbox; if (listbox.selecteditem != null) { var myselecteditem = listbox.selecteditem user; if (myselecteditem != null) { dragdrop.dodragdrop(listbox, myselecteditem, dragdropeffects.copy | dragdropeffects.move); } } } }
Comments
Post a Comment