private void panelTop_DoubleClick(object sender, EventArgs e) { FrmNumSet frmNumSet = new FrmNumSet(); if (frmNumSet.ShowDialog() == DialogResult.OK && frmNumSet.Value.ToString() == "112233") { FrmParamSet frmParamSet = new FrmParamSet(); frmParamSet.ShowDialog(); } }
private void lblStandardQuantity_Click(object sender, EventArgs e) { FrmNumSet frmNumSet = new FrmNumSet(); decimal currentValue = 0; decimal.TryParse(lblStandardQuantity.Text, out currentValue); frmNumSet.Value = currentValue; if (frmNumSet.ShowDialog() == DialogResult.OK) { lblStandardQuantity.Text = frmNumSet.Value.ToString(); } }
private void dataView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { int rowIndex = e.RowIndex; DataGridViewRow dgvr = dataView1.Rows[rowIndex]; if (dgvr.Cells[e.ColumnIndex].Value.ToString() == "修改") { FrmNumSet frmNumSet = new FrmNumSet(); decimal currentValue = 0; decimal.TryParse(dgvr.Cells["CurrentValue"].Value.ToString(), out currentValue); frmNumSet.Value = currentValue; if (frmNumSet.ShowDialog() == DialogResult.OK) { opcReadAndWrite.SyncWrite(dgvr.Cells["KepAddress"].Value.ToString(), frmNumSet.Value.ToString()); } } }