private void FrmMain_DragDrop(object sender, DragEventArgs e) { pictureDrag.Visible = false; string path = ((string[])e.Data.GetData(DataFormats.FileDrop))[0]; if (Directory.Exists(path)) { labelErrorMessage.Text = string.Empty; IconError.Visible = false; TxtFolderName.Text = path; fileCount = LibFunctions.SearchDirectoryTree(path, out XLSfiles); labelInfo.Text = fileCount + " Excel files found"; } }
// Handle Event Click of Buttton Load Folder private void BtnLoad_Click(object sender, EventArgs e) { labelErrorMessage.Text = string.Empty; pictureDrag.Visible = false; IconError.Visible = false; FolderBrowserDialog FD = new FolderBrowserDialog(); if (FD.ShowDialog() == DialogResult.OK) { TxtFolderName.Text = FD.SelectedPath; fileCount = LibFunctions.SearchDirectoryTree(FD.SelectedPath, out XLSfiles); labelInfo.Text = fileCount + " Excel files found"; } }