using System;
using System.Windows.Forms;

namespace C_Windows_1
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }

        private void Form3_Load(object sender, EventArgs e)
        {
            function1.Hide();
            function2.Hide();
            function3.Hide();
            LinkLabel2.Hide();
            function5.Hide();
        }


        private void BtnManual1_Click(object sender, EventArgs e)
        {
            function1.Show();
            function2.Hide();
            function3.Hide();
            function5.Hide();
            Label3.Hide();
            LinkLabel2.Hide();
        }

        private void BtnManual2_Click(object sender, EventArgs e)
        {
            function1.Hide();
            function2.Show();
            function3.Hide();
            function5.Hide();
            Label3.Hide();
            LinkLabel2.Hide();
        }

        private void BtnManual3_Click(object sender, EventArgs e)
        {
            function1.Hide();
            function2.Hide();
            function3.Show();
            function5.Hide();
            Label3.Hide();
            LinkLabel2.Hide();
        }

        private void BtnManual4_Click(object sender, EventArgs e)
        {
            function1.Hide();
            function2.Hide();
            function3.Hide();
            function5.Hide();
            Label3.Show();
            LinkLabel2.Hide();
        }

        private void BtnManual5_Click(object sender, EventArgs e)
        {
            function1.Hide();
            function2.Hide();
            function3.Hide();
            Label3.Hide();
            function5.Show();
            LinkLabel2.Show();
        }

        private void LinkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Form4 Form4 = new Form4();
            //  Form4.Show();
            OpenForm(Form4);
        }

        public void OpenForm(System.Windows.Forms.Form frm)
        {
            if (frm == null) return;
            foreach (System.Windows.Forms.Form f in System.Windows.Forms.Application.OpenForms)
            {
                if (f.Name == frm.Name)
                {
                    f.Activate();
                    f.Show();
                    frm.Dispose();
                    System.GC.Collect();
                    System.GC.WaitForPendingFinalizers();
                    return;
                }
            }
            frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            frm.Show();
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
        }

        private void LinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://www.shzhll.com/");
        }
    }
}
