using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Text;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Car_wash
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btndashboard_Click(object sender, EventArgs e)
        {
            panelSilde.Height = btndashboard.Height;
            panelSilde.Top = btndashboard.Top;
        }

        private void btnEmployer_Click(object sender, EventArgs e)
        {
            panelSilde.Height = btnEmployer.Height;
            panelSilde.Top = btnEmployer.Top;
            openchildform(new Employer());
        }

        private void btncustomer_Click(object sender, EventArgs e)
        {
            panelSilde.Height = btncustomer.Height;
            panelSilde.Top = btncustomer.Top;
        }

        private void btnservice_Click(object sender, EventArgs e)
        {
            panelSilde.Height = btnservice.Height;
            panelSilde.Top = btnservice.Top;
        }

        private void btncash_Click(object sender, EventArgs e)
        {
            panelSilde.Height = btncash.Height;
            panelSilde.Top = btncash.Top;
        }

        private void btnReport_Click(object sender, EventArgs e)
        {
            panelSilde.Height = btnReport.Height;
            panelSilde.Top = btnReport.Top;
        }

        private void btnsetting_Click(object sender, EventArgs e)
        {
            panelSilde.Height = btnsetting.Height;
            panelSilde.Top = btnsetting.Top;
            openchildform(new setting());
        }

        private void pictureBox6_Click(object sender, EventArgs e)
        {

        }

        #region method
        // create a function to open a form inside a panel
       
            private Form activeform = null;
            public void openchildform(Form childform)
            {
                if (activeform != null)
                    activeform.Close();
                activeform = childform;
                childform.TopLevel = false;
                childform.FormBorderStyle = FormBorderStyle.None;
                childform.Dock = DockStyle.Fill;
                panelchild.Controls.Add(childform);
                panelchild.Tag = childform;
                childform.BringToFront();
                childform.Show();
        }


        #endregion method
    }
}
