Example #1
0
        private void Category_Record_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            Category frm = new Category();

            frm.MdiParent = Main.ActiveForm;
            frm.Show();
        }
Example #2
0
 private void categoryToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Global.category++;
     if (Global.category == 1)
     {
         Category category = new Category();
         category.Show();
     }
 }
Example #3
0
 private void categoriesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Global.category++;
     if (Global.category == 1)
     {
         Category frm = new Category();
         frm.MdiParent = this;
         frm.Show();
     }
 }
Example #4
0
        private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            DataGridViewRow dr = dataGridView1.SelectedRows[0];

            this.Hide();
            Category frm = new Category();

            frm.MdiParent = Main.ActiveForm;
            // or simply use column name instead of index
            //dr.Cells["id"].Value.ToString();
            frm.Show();
            frm.txtCategoryName.Text = dr.Cells[0].Value.ToString();
            frm.textBox1.Text        = dr.Cells[0].Value.ToString();
            frm.btnDelete.Enabled    = true;
            frm.btnUpdate.Enabled    = true;
            frm.txtCategoryName.Focus();
            frm.btnSave.Enabled = false;
        }