/// <summary> /// 中间标准列头 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void lstStdHead_SelectedIndexChanged(object sender, EventArgs e) { if (this.lstStdHead.SelectedIndex != -1) { this.standName = (HeadName)this.lstStdHead.SelectedItem; } }
/// <summary> /// 中间标准列头 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbHead_SelectedIndexChanged(object sender, EventArgs e) { if (this.cmbHead.SelectedIndex >= 0) { this.standName = (HeadName)cmbHead.SelectedItem; } else { this.standName = (HeadName)cmbHead.Items[0]; } }
/// <summary> /// 获取列在文件中的 第几列 /// </summary> /// <param name="headName"></param> /// <returns></returns> private int GetHeadIndexByName(HeadName headName) { if (this.HeadSelected.Count <= 0) { return(-1); } foreach (Head h in this.HeadSelected) { if (h.StandName == headName) { return(h.Index); } } return(-1); }