SMALL
- 드롭될 해당 컨트롤의 AllowDrop을 true로 설정
private void textBox52_DragDrop(object sender, DragEventArgs e)
{
string[] strFileNames = e.Data.GetData(DataFormats.FileDrop) as string[];
foreach (string strFilePath in strFileNames)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
textBox52.AppendText(System.IO.File.ReadAllText(strFilePath));
}
}
// // 파일의 내용을 텍스트박스에 추가
// //txtMain.AppendText( System.IO.File.ReadAllText(strFilePath));
// // 파일의 내용만 텍스트박스에 출력
// textBox52.Text += System.IO.File.ReadAllText(strFilePath);
// // 하나만 출력하고 그대로 빠져나감
// //break;
// DragDrop은 리스트 컨트롤에 마우스를 드래그해서 놓았을때 발생하는 함수
button16_Click(sender, e);
}
참고링크
https://great-artist.tistory.com/96
https://www.csharpstudy.com/WinForms/WinForms-dragdrop.aspx
LIST
'일반' 카테고리의 다른 글
C# 로또 조합번호 전부 가져오기 (0) | 2022.03.24 |
---|---|
2022.03.21_발정데이터_farm3797_09시&17시 (0) | 2022.03.21 |
Json Serialize desrialize 예제 (0) | 2022.03.16 |
C# 책 포스팅 (0) | 2022.03.16 |
MSSQL DBO (0) | 2022.03.14 |