tags:

views:

99

answers:

1

I'm working with WPF, and trying to implement a form to receive a Drag and Drop link, and assign to a button on a record (attach links to files to a record).

I can get the link path with no issue. I'm stuck trying to extract the icon file from the link, and convert and render it.

    private void frmMain_Drop(object sender, DragEventArgs e)
    {
        String[] sFileList = (String[])e.Data.GetData(DataFormats.FileDrop);
        foreach (String sFilename in sFileList)
        {

            String sNew = sFilename;
        }
    }

That is what I have so far.

Thanks!

+1  A: 

Would this work for you?

myImageControl.Source = new BitmapImage(new Uri(sFilename));

Where myImageControl is an Image declared somewhere in your application's XAML:

<Image x:Name="myImageControl" />
Isak Savo