form中有一个button1.
一个panel,panel里有个label
我点击button1,下面的panel就全屏幕显示在电脑上。鼠标双击或者键盘按esc退出全屏。
怎么实现?

解决方案 »

  1.   

    http://download.csdn.net/detail/jiayp004/3439634
      

  2.   

    只能是窗体全屏,设置窗体的topmost=true;和窗体的大小就行了
    panel和label自动申缩
      

  3.   

    Dock属性控制panel 如何填充form,
    WindowState = FormWindowState.Maximized窗体最大化
    双击退出全屏的话,有双击事件,esc退出全屏的话,PreviewKeyDown事件中,判断键盘的KEY值
      

  4.   

    貌似2L正解,你需要窗体全屏,然后Panel自动拉伸就好,按照百分比设置也行。
    其次3L提供的ESC退出也没有问题
      

  5.   

    貌似2L正解,你需要窗体全屏,然后Panel自动拉伸就好,按照百分比设置也行。
    其次3L提供的ESC退出也没有问题
      

  6.   

    貌似2L正解,你需要窗体全屏,然后Panel自动拉伸就好,按照百分比设置也行。
    其次3L提供的ESC退出也没有问题
      

  7.   

    private void button1_Click(object sender, EventArgs e)
            {
                this.WindowState = FormWindowState.Maximized;
            }
    然后把Panel的Anchor属性设置为TOP,LELF,RIGHT,BOTTON
      

  8.   

    全屏        [DllImport("user32.dll", SetLastError = true)]
            static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
            private void button1_Click(object sender, EventArgs e)
            {
                SetParent(panel1.Handle, IntPtr.Zero);
                panel1.Left = 0;
                panel1.Top = 0;
                panel1.Width = Screen.PrimaryScreen.Bounds.Width;
                panel1.Height = Screen.PrimaryScreen.Bounds.Height;
            }        private void panel1_DoubleClick(object sender, EventArgs e)
            {
                SetParent(panel1.Handle, IntPtr.Zero);
                //看下开始时候panel1的属性
                this.panel1.Location = new System.Drawing.Point(294, 119);
                this.panel1.Size = new System.Drawing.Size(111, 49);
            }
      

  9.   

            [DllImport("user32.dll", SetLastError = true)]
            static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
            private void button1_Click(object sender, EventArgs e)
            {
                SetParent(panel1.Handle, IntPtr.Zero);
                panel1.Left = 0;
                panel1.Top = 0;
                panel1.Width = Screen.PrimaryScreen.Bounds.Width;
                panel1.Height = Screen.PrimaryScreen.Bounds.Height;
            }        private void panel1_DoubleClick(object sender, EventArgs e)
            {
                //开始时候panel1的属性
                panel1.Location = new System.Drawing.Point(294, 119);
                panel1.Size = new System.Drawing.Size(111, 49);
            }
      

  10.   

          测试通过,代码如下:
            private void button1_Click(object sender, EventArgs e)
            {
                Form test1 = new Form();
                try
                {
                    test1.ShowInTaskbar = false;
                    test1.FormBorderStyle = FormBorderStyle.None;
                    test1.WindowState = FormWindowState.Maximized;                test1.Controls.Add(this.panel1);
                    this.Controls.Remove(this.panel1);
                    this.panel1.Dock = DockStyle.Fill;
                    test1.KeyDown += new KeyEventHandler(test1_KeyDown);
                    test1.ShowDialog();
                }
                finally
                {
                    this.panel1.Dock = DockStyle.None;
                    this.Controls.Add(this.panel1);
                    test1.Close();
                }
            }
            private void test1_KeyDown(object sender, KeyEventArgs e)
            {
                if(e.KeyCode == Keys.Escape)
                {
                    ((Form)sender).Close();
                }
            }