winform实现把外部文件拖入PictureBox的代码示例
来源:互联网 发布:mac os 11 yosemite 编辑:程序博客网 时间:2024/06/06 23:19
private void Form1_Load(object sender, EventArgs e)
{
//这句代码不会报错,但是需要手动输入,.net编辑器无法自动识别AllowDrop
this.pictureBox1.AllowDrop = true;
}
private void pictureBox1_DragDrop(object sender, DragEventArgs e)
{
string fileName = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString();
this.pictureBox1.Image = Image.FromFile(fileName);
}
private void pictureBox1_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.Link;
else e.Effect = DragDropEffects.None;
}
- winform实现把外部文件拖入PictureBox的代码示例
- C#把外部文件拖入PictureBox中
- C# WinForm下实现文件的拖入和拖出
- 把文件拖入窗体的例子
- C# WinForm 实现文件的拖入和拖出(拖拽操作)
- C# WinForm 实现文件的拖入和拖出(拖拽操作)
- C# WinForm下一步一步实现文件的拖入和拖出
- C# WinForm下一步一步实现文件的拖入和拖出
- C# WinForm下一步一步实现文件的拖入和拖出
- C# WinForm下一步一步实现文件的拖入和拖出
- WinForm中实现picturebox自适应图片大小的方法
- winform拖拽:实现外部文件拖拽到程序内以及程序内部间的拖拽
- [WINFORM]PictureBox顯示圖片的方式
- 新建winform项目,在其中拖入2个button和1个 PictureBox,1Openfiledialog用Graphics\pen\brush\color\Font\的属性画出不同图案
- 将文件拖入winform并读取
- c# winform pictureBox显示图片,PictureBox控件的Image属性
- c# winform pictureBox显示图片,PictureBox控件的Image属性
- java实现文件过滤的示例代码
- Launcher workspace 定制分析
- 二进制日志占满空间
- ffmpeg中的sws_scale算法性能测试
- js中window.onload与jquery中$(document.ready())的区别
- HDU--1010 -- Tempter of the Bone [DFS+经典奇偶剪枝]
- winform实现把外部文件拖入PictureBox的代码示例
- live555 linux 编译
- eclipse 启动Tomcat超时错误
- poj 3415 , poj 3581,BZOJ 3538
- Gallery is deprecated:Gallery 过期了怎么办?(一)
- struts 学习方略
- Windows下的ffmpeg编译
- 在源eclipse上,以安装插件方式,安装myeclipse
- 监视RMAN通道例子