Пример #1
0
        private void Left_Screen_Button_Click(object sender, EventArgs e)
        {
            LeftScreenForm form = new LeftScreenForm();

            form.Location = new System.Drawing.Point(0, 0);
            form.Show();
        }
Пример #2
0
        private void Show_Left_Screen_Button_Click(object sender, EventArgs e)
        {
            if (this.Show_Left_Screen_Button.Text == "Show")
            {
                LeftScreenForm form = new LeftScreenForm();

                form.Location = GetLocationFor("Left");
                form.Size     = GetSizeFor("Left");

                form.Show();

                this.Show_Left_Screen_Button.Text = "Hide";
            }
            else
            {
                var leftForm = Application.OpenForms.OfType <LeftScreenForm>().FirstOrDefault();

                if (leftForm != null)
                {
                    leftForm.Dispose();
                    this.Show_Left_Screen_Button.Text = "Show";
                }
            }
        }