Пример #1
0
        private void BtnNewCity_Click(object sender, EventArgs e)
        {
            frmCityDetails frm = new frmCityDetails();

            frm.TopLevel   = false;
            frm.AutoScroll = false;
            panel1.Controls.Clear();
            panel1.Controls.Add(frm);
            panel1.Controls.SetChildIndex(frm, 0);
            frm.Show();
        }
Пример #2
0
        private void CitiesGrid_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            var id = citiesGrid.SelectedRows[0].Cells[0].Value;

            frmCityDetails frm = new frmCityDetails(int.Parse(id.ToString()))
            {
                TopLevel    = false,
                AutoScroll  = false,
                WindowState = FormWindowState.Maximized
            };

            this.Parent.Controls.Add(frm);
            frm.Show();
        }