C#文件拖到TextBox中获取文件显示文件路径
2021-05-06 00:26
标签:none bsp col div send str code rgs span C#文件拖到TextBox中获取文件显示文件路径 标签:none bsp col div send str code rgs span 原文地址:http://www.cnblogs.com/jephone/p/7675576.htmlprivate void textBox1_DragDrop(object sender, DragEventArgs e)
{
textBox1.Text = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString();
}
private void textBox1_DragEnter(object sender, DragEventArgs e)
{
if (e.Data .GetDataPresent(DataFormats .FileDrop ))
{
e.Effect = DragDropEffects.Link;
}
else
{
e.Effect = DragDropEffects.None;
}
}
文章标题:C#文件拖到TextBox中获取文件显示文件路径
文章链接:http://soscw.com/index.php/essay/82961.html