Example #1
0
 private void Btn4_Click(object sender, EventArgs e)
 {
     try
     {
         tableLayoutPanelContent.Controls.Clear();
         resetButtonsStoreDetailsPanelStyle();
         Button btn = (Button)sender;
         btn.ForeColor = Color.Black;
         btn.BackColor = Color.White;
         SparePart objForm = new SparePart();
         objForm.TopLevel = false;
         tableLayoutPanelContent.Controls.Add(objForm);
         objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         objForm.Dock            = DockStyle.Fill;
         objForm.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        //Spare Part
        private void navBarItem3_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            try
            {
                restForeColorOfNavBarItem();
                NavBarItem navBarItem = (NavBarItem)sender;
                navBarItem.Appearance.ForeColor = Color.Blue;
                if (!xtraTabControlCarsContent.Visible)
                {
                    xtraTabControlCarsContent.Visible = true;
                }

                XtraTabPage xtraTabPage = getTabPage("قطع الغيار");
                if (xtraTabPage == null)
                {
                    xtraTabControlCarsContent.TabPages.Add("قطع الغيار");
                    xtraTabPage = getTabPage("قطع الغيار");
                }

                xtraTabPage.Controls.Clear();
                xtraTabControlCarsContent.SelectedTabPage = xtraTabPage;

                SparePart objForm = new SparePart(this);

                objForm.TopLevel = false;
                xtraTabPage.Controls.Add(objForm);
                objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                objForm.Dock            = DockStyle.Fill;

                objForm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }