Beispiel #1
0
        private void ToolStripButton3_Click(object sender, EventArgs e)
        {
            CityForm frm = new CityForm();

            frm.Text      = "New City";
            frm.TopLevel  = false;
            frm.MdiParent = this.MdiParent;
            frm.Show();
        }
Beispiel #2
0
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var rowIndex = dgvCityList.SelectedRows[0].Index;

            City city = Get(rowIndex);

            if (city != null)
            {
                CityForm frm = new CityForm(city);
                frm.Text      = "Edit City";
                frm.TopLevel  = false;
                frm.MdiParent = this.MdiParent;
                frm.Show();
            }
        }
Beispiel #3
0
        private void dgvCityList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var rowIndex = e.RowIndex;

            if (rowIndex >= 0)
            {
                City city = Get(rowIndex);
                if (city != null)
                {
                    CityForm frm = new CityForm(city);
                    frm.Name      = "Edit City";
                    frm.TopLevel  = false;
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }
        }