ICSharpCode.TextEditor DragDrop事件被禁用,
有哪位大神知道如何实现读取拖拽文件的内容到文本框吗?
下面的代码在RichTextBox里能实现
private void Rth_TextBox_DragDrop(object sender, DragEventArgs e)
{
try
{
Array arrayFileName = (Array)e.Data.GetData(DataFormats.FileDrop);
string strFileName = arrayFileName.GetValue(0).ToString();
StreamReader sr = new StreamReader(strFileName, Encoding.Default);
tec_RWInstruction.Text = sr.ReadToEnd();
sr.Close();
}
catch (Exception ex)
{
AppendLog(ex.Message, FailColor);
}
}