private void txtExcelPath_TextChanged(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; cbxSheet.Items.Clear(); var listSheetName = cldt.GetSheetName(txtExcelPath.Text); foreach (var item in listSheetName) { cbxSheet.Items.Add(item); } if (listSheetName.Count > 0) { // set default sheet name cbxSheet.Text = listSheetName[0]; } Cursor = Cursors.Arrow; }