C# textbox拖入路径
2021-01-28 12:16
标签:enter one vat oid link 路径 form file lse private void txt_file_DragDrop(object sender, DragEventArgs e) string strFileName = this.txt_file.Text.Trim(); if (strFileName.Substring(strFileName.Length - 4, 4) != ".csv" private void txt_file_DragEnter(object sender, DragEventArgs e) C# textbox拖入路径 标签:enter one vat oid link 路径 form file lse 原文地址:https://www.cnblogs.com/-jwj/p/11891363.html
{
((TextBox)sender).Text = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString();
if (strFileName == "") return;
&& strFileName.Substring(strFileName.Length - 4, 4) != ".CSV")
{
this.txt_file.Text = strFileName + ".csv";
}
}
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
e.Effect = DragDropEffects.Link;
}
else
{
e.Effect = DragDropEffects.None;
}
}