Пример #1
0
        void control_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                try
                {
                    if (this.webBrowser1 != null)
                    {
                        if (frm != null)
                        {
                            frm.Controls.Clear();
                            this.Controls.Add(this.webBrowser1);

                            frm.Close();
                            frm = null;
                        }
                    }
                    this.Controls.Add(this.btnFullScreen);
                    this.btnFullScreen.Click -= new EventHandler(btnFullScreen_Click);
                    this.btnFullScreen.Click += new EventHandler(btnFullScreen_Click);
                    webBrowser1.SendToBack();
                    btnFullScreen.BringToFront();
                    btnFullScreen.Focus();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Пример #2
0
 private void btnFullScreen_Click(object sender, EventArgs e)
 {
     frm = new HydrantFullScreen();
     AddEventKeyUp(this.webBrowser1);
     this.Controls.Clear();
     frm.Controls.Add(this.webBrowser1);
     frm.ShowDialog();
 }