private void UcAnalyLevel_TranferToSx(object sender, DataGridViewCellEventArgs e) { UcAnalyLevel ucAnalyLevel = (UcAnalyLevel)(sender); e = ClickEventE; this.dgvCcAnalys1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = ucAnalyLevel.GetSelectedContext(); if (e.ColumnIndex == 7) { string liText = this.dgvCcAnalys1.Rows[e.RowIndex].Cells[8].Value == null?"": this.dgvCcAnalys1.Rows[e.RowIndex].Cells[8].Value.ToString(); if (liText.Length > 0) { string slStr = "Ri" + this.dgvCcAnalys1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() + liText; SetRiValue(slStr, e); } } if (e.ColumnIndex == 12) { string lText = this.dgvCcAnalys1.Rows[e.RowIndex].Cells[13].Value == null?"": this.dgvCcAnalys1.Rows[e.RowIndex].Cells[13].Value.ToString(); if (lText.Length > 0) { string slStr = "R" + this.dgvCcAnalys1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() + lText; SetRiValue(slStr, e); } } }
//创建窗体对象的静态方法 public static UcAnalyLevel InstanceObject() { if (_instance == null) { _instance = new UcAnalyLevel(); } return(_instance); }
/// <summary> /// datagridview单击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvCcAnalys1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { //选中“参数+引导词” if (e.ColumnIndex == 2) { if (this.trvUcAnaly != null && this.trvUcAnaly.SelectedNode.Level == 2) { UcAnalyCombox ucAnalyCombox = UcAnalyCombox.InstanceObject(); //订阅事件 ClickEventE = e; ucAnalyCombox.TransferToCombox += new System.Action <object, DataGridViewCellEventArgs>(UcAnalyCombox_TransferToCombox); ucAnalyCombox.ReceiveSelectedTreeNode = this.trvUcAnaly.Tag.ToString(); ucAnalyCombox.Focus(); ucAnalyCombox.Show(); } } //选中F0 if (e.ColumnIndex == 5) { UcAnalyProbility ucAnalyProbility = UcAnalyProbility.InstanceObject(); ucAnalyProbility.Text = "F0"; //订阅事件 ucAnalyProbility.TransferToFx += new System.Action <object, DataGridViewCellEventArgs>(UcAnalyProbility_TranferToFx); ClickEventE = e; ucAnalyProbility.Focus(); ucAnalyProbility.Show(); } //选中Fs if (e.ColumnIndex == 11) { UcAnalyProbility ucAnalyProbility = new UcAnalyProbility(); ucAnalyProbility.Text = "Fs"; //订阅事件 ucAnalyProbility.TransferToFx += new System.Action <object, DataGridViewCellEventArgs>(UcAnalyProbility_TranferToFx); ClickEventE = e; ucAnalyProbility.Show(); } //选中Si if (e.ColumnIndex == 7) { UcAnalyLevel ucAnalyLevel = UcAnalyLevel.InstanceObject(); ucAnalyLevel.Text = "Si"; //订阅事件 ucAnalyLevel.TransferToSx += new System.Action <object, DataGridViewCellEventArgs>(UcAnalyLevel_TranferToSx); ClickEventE = e; ucAnalyLevel.Focus(); ucAnalyLevel.Show(); } //选中S if (e.ColumnIndex == 12) { UcAnalyLevel ucAnalyLevel = UcAnalyLevel.InstanceObject(); ucAnalyLevel.Text = "S"; //订阅事件 ucAnalyLevel.TransferToSx += new System.Action <object, DataGridViewCellEventArgs>(UcAnalyLevel_TranferToSx); ClickEventE = e; ucAnalyLevel.Focus(); ucAnalyLevel.Show(); } //选中Li if (e.ColumnIndex == 8) { UcAnalsFrequency ucAnalsFrequency = UcAnalsFrequency.InstanceObject(); ucAnalsFrequency.Text = "Li"; //订阅事件 ucAnalsFrequency.TransferToLx += new System.Action <object, DataGridViewCellEventArgs>(UcAnalsFrequency_TranferToLx); ClickEventE = e; ucAnalsFrequency.Focus(); ucAnalsFrequency.Show(); } //选中L if (e.ColumnIndex == 13) { UcAnalsFrequency ucAnalsFrequency = UcAnalsFrequency.InstanceObject(); ucAnalsFrequency.Text = "L"; //订阅事件 ucAnalsFrequency.TransferToLx += new System.Action <object, DataGridViewCellEventArgs>(UcAnalsFrequency_TranferToLx); ClickEventE = e; ucAnalsFrequency.Focus(); ucAnalsFrequency.Show(); } } }
private void UcAnalyLevel_FormClosing(object sender, FormClosingEventArgs e) { _instance = null; }