//*****************************************************************************// // *** STRIP MENU BUTTONS *** // //*****************************************************************************// // Strip Menu ADD button private void addlStripButton_Click(object sender, EventArgs e) { // prepare DataGridViewRow rowstring = null; PackagesForm packForm = new PackagesForm(rowstring); packForm.MdiParent = this.MdiParent; packForm.Show(); }
private void dgvPackageList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { // Store current row in variable DataGridViewRow rowstring = dgvPackageList.CurrentRow; // Send the row to a new form PackagesForm packForm = new PackagesForm(rowstring); packForm.MdiParent = this.MdiParent; packForm.Show(); }
// Press Enter Handler private void dgvPackageList_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) { // Store current row in variable DataGridViewRow rowstring = dgvPackageList.CurrentRow; // Send the row to a new form PackagesForm packForm = new PackagesForm(rowstring); packForm.MdiParent = this.MdiParent; packForm.Show(); } }
//*************************************************************// //*** METHOD DETECTES CHANGES IN PACKAGES_FORM ***// //*************************************************************// public static void captureChanges(PackagesForm packForm) { packForm.txtName.TextChanged += new System.EventHandler(txtDesc_TextChanged); packForm.txtBasePrice.TextChanged += new System.EventHandler(txtDesc_TextChanged); packForm.txtAgComm.TextChanged += new System.EventHandler(txtDesc_TextChanged); packForm.txtDesc.TextChanged += new System.EventHandler(txtDesc_TextChanged); packForm.tpStartDate.TextChanged += new System.EventHandler(txtDesc_TextChanged); packForm.tpEndDate.TextChanged += new System.EventHandler(txtDesc_TextChanged); packForm.imgDescription.TextChanged += new System.EventHandler(txtDesc_TextChanged); packForm.dgvPackProdSuppl.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(txtDesc_TextChanged); packForm.dgvPackProdSuppl.RowsAdded += new System.Windows.Forms.DataGridViewRowsAddedEventHandler(txtDesc_TextChanged); packForm.dgvPackProdSuppl.RowsRemoved += new System.Windows.Forms.DataGridViewRowsRemovedEventHandler(txtDesc_TextChanged); void txtDesc_TextChanged(object sender, EventArgs e) { packForm.Text = "Package Form [Changed]*"; Constants.packageIsChanged = true; } }