w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
WPF dealing with files in a listBox

You can do it using the DragDrop.DoDragDrop method.

Example:

    <ListBox
SelectionChanged="Selector_OnSelectionChanged">
        <ListBoxItem>X</ListBoxItem>
        <ListBoxItem>Y</ListBoxItem>
        <ListBoxItem>Z</ListBoxItem>
    </ListBox>

And in code

private void Selector_OnSelectionChanged(object sender,
SelectionChangedEventArgs e)
{
     ListBox listbox = sender as ListBox;
     DragDrop.DoDragDrop(listbox, listbox.SelectedItem,
DragDropEffects.None);
}

Could be that in your mp4 player you'll need to implement more than just enable drag&Drop (like extract dragged item and play it ...)

You can find more information about on MSDN Drag and Drop Overview page.

Hope this helps





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.