private void txtCust_Click(object sender, EventArgs e) { ProductionNew.DialogPeaple p = new DialogPeaple(); p.StartPosition = FormStartPosition.CenterScreen; p.ShowDialog(); if (p.DialogResult == System.Windows.Forms.DialogResult.OK) { this.txtRepairId.Text = loadId(); this.txtCust.Text = "[" + p.CustomerId + "] " + p.CustomerName; } }
private void textBox1_Click(object sender, EventArgs e) { ProductionNew.DialogPeaple p = new DialogPeaple("no"); p.ShowDialog(); if (p.DialogResult == System.Windows.Forms.DialogResult.OK) { DataGridViewRow r = p.dataGridView1.CurrentRow; textBox1.Text = "[" + r.Cells["CustomerId"].Value.ToString() + "] " + r.Cells["CustomerName"].Value.ToString(); } }