Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Listbox deselected on drag start

$
0
0

When I start dragging all items get deselected. Do you have a suggestion how can I do this?

<ListBox x:Name="FileListBox" ... SelectionMode="Extended"  PreviewMouseMove="List_MouseMove" >

private void List_MouseMove(object sender, MouseEventArgs e)
{
  if (e.LeftButton == MouseButtonState.Pressed )
  {
    cList files = GetSelectedFiles();
    string dataFormat = DataFormats.FileDrop;
    DataObject dataObject = new DataObject("myFormat", files);
    DragDrop.DoDragDrop(FileListBox, dataObject, DragDropEffects.Copy);
  }
}


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>