private void bánToolStripMenuItem_Click(object sender, EventArgs e) { Forms.frmHoadonban f = new Forms.frmHoadonban(); f.StartPosition = FormStartPosition.CenterScreen; this.Hide(); f.ShowDialog(); this.Show(); }
private void DataGridView_DoubleClick(object sender, EventArgs e) { string mahd; if (MessageBox.Show("Bạn có muốn hiển thị thông tin chi tiết?", "Xác nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { mahd = DataGridView.CurrentRow.Cells["MaHDB"].Value.ToString(); frmHoadonban frm = new frmHoadonban(); cboMaHDB.Text = mahd; frm.StartPosition = FormStartPosition.CenterScreen; frm.ShowDialog(); } }
private void DataGridView1_DoubleClick(object sender, EventArgs e) { if (tblTKHDB.Rows.Count == 0) { MessageBox.Show("Không có dữ liệu!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } string mahd; if (MessageBox.Show("Bạn có muốn hiển thị thông tin chi tiết?", "Xác nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { mahd = DataGridView1.CurrentRow.Cells["MaHDB"].Value.ToString(); frmHoadonban frm = new frmHoadonban(); frm.txtMaHDBan.Text = mahd; frm.StartPosition = FormStartPosition.CenterParent; frm.ShowDialog(); } }