winform 如何把某个程序拖到窗体内................
winform 如何把某个程序拖到窗体内并记录下来,比如把notepad.exe 拖到窗体内,然后窗体就会显示出这个记事本的图标,并且,如果双击这个图标,会运行notepad.exe程序,请教了。。。(类似于一个程序"收集"的小工具)。
谢谢 --------------------编程问答-------------------- 就是加一个快捷方式而已 --------------------编程问答-------------------- 先处理Form的DragDrop事件,获取拖放的路径,然后根据路径获取图标并记录文件路径,下次点击的时候就启动这个文件。 --------------------编程问答-------------------- void treeView1_DragDrop(object sender, DragEventArgs e)
{
if (SData.NowNode == null)
{
return;
}
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
files = (string[])(e.Data.GetData(DataFormats.FileDrop));
SetFile add = new SetFile(files, SData.NowNode.Name);
Gwg.BaseLibrary.PublicClass.Loading ld = new Gwg.BaseLibrary.PublicClass.Loading();
ld.GetMethod += new Gwg.BaseLibrary.PublicClass.Loading.MyDelegate(add.AddFile);
ld.RunLoading("正在上传文件:");
}
}
void treeView1_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All;
}
补充:.NET技术 , C#