Αν εννοείς με drag and drop πιάσε τα events ή κάνε override όπως παρακάτω:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace DragDrop
{
public partial class frmDragDrop : Form
{
public frmDragDrop()
{
InitializeComponent();
this.AllowDrop = true;
}
protected override void OnDragEnter(DragEventArgs drgevent)
{
if (drgevent.Data.GetDataPresent(DataFormats.FileDrop))
drgevent.Effect = DragDropEffects.Copy;
else
drgevent.Effect = DragDropEffects.None;
base.OnDragEnter(drgevent);
}
protected override void OnDragDrop(DragEventArgs drgevent)
{
string[] files = drgevent.Data.GetData(DataFormats.FileDrop) as string[];
if (files != null)
{
foreach (string file in files)
{
if (System.IO.File.Exists(file))
this.BackgroundImage = Icon.ExtractAssociatedIcon(file).ToBitmap();
}
}
base.OnDragDrop(drgevent);
}
}
}