//function //cars public void bindRecordCarForm(Cars cars) { Car_Record objForm = new Car_Record(cars, xtraTabControlCarsContent); objForm.TopLevel = false; XtraTabPage xtraTabPage = getTabPage("أضافة سيارة"); if (xtraTabPage == null) { xtraTabControlCarsContent.TabPages.Add("أضافة سيارة"); xtraTabPage = getTabPage("أضافة سيارة"); } xtraTabPage.Controls.Clear(); xtraTabPage.Controls.Add(objForm); xtraTabControlCarsContent.SelectedTabPage = xtraTabPage; objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; objForm.Dock = DockStyle.Fill; objForm.Show(); }
//main buttons private void btnAdd_Click(object sender, EventArgs e) { try { if (carRecord == null) { carRecord = new Car_Record(this); carRecord.Show(); carRecord.Focus(); } else { carRecord.Show(); carRecord.Focus(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }