//选择不同的输出类型 /// <summary> /// 全选 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SelectAllButtonClick(object sender, EventArgs e) { for (int i = 0; i < TableCheckBoxList.Items.Count; i++) { if (!TableCheckBoxList.GetItemChecked(i)) { TableCheckBoxList.SetItemChecked(i, true); } } }
/// <summary> /// 重置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ResetButtonClick(object sender, EventArgs e) { for (int i = 0; i < TableCheckBoxList.Items.Count; i++) { if (TableCheckBoxList.GetItemChecked(i)) { TableCheckBoxList.SetItemChecked(i, false); } } }
/// <summary> /// 返回选中的excel文件。 /// </summary> /// <returns></returns> private List <FileInfo> GetCurrentSelectFileInfos() { List <FileInfo> fileInfos = new List <FileInfo>(); for (int i = 0; i < TableCheckBoxList.Items.Count; i++) { if (TableCheckBoxList.GetItemChecked(i)) { fileInfos.Add((FileInfo)TableCheckBoxList.Items[i]); } } return(fileInfos); }