zoukankan      html  css  js  c++  java
  • WPF 全屏

    前台页面:

    <Grid>
            <Button Content="全屏" Height="47" HorizontalAlignment="Left" Margin="157,124,0,0" Name="button1" VerticalAlignment="Top" Width="146" Click="button1_Click" />
        </Grid>

    后台代码:

    bool Flag = false;
            private void button1_Click(object sender, RoutedEventArgs e)
            {
                // 设置全屏  
                
                
                if (Flag)
                {
                    this.WindowState = System.Windows.WindowState.Normal;
                    this.WindowStyle = System.Windows.WindowStyle.None;
                    this.ResizeMode = System.Windows.ResizeMode.NoResize;
                    this.Topmost = true;
    
                    this.Left = 0.0;
                    this.Top = 0.0;
                    this.Width = System.Windows.SystemParameters.PrimaryScreenWidth;
                    this.Height = System.Windows.SystemParameters.PrimaryScreenHeight;
    
                    Flag = false;
    
                }
                else
                {
                    this.WindowState = System.Windows.WindowState.Normal;
                    this.WindowStyle = System.Windows.WindowStyle.SingleBorderWindow;
                    this.ResizeMode = System.Windows.ResizeMode.CanResize;
                    this.Topmost = true;
    
                    this.Left = 0.0;
                    this.Top = 0.0;
                    this.Width = 1350;
                    this.Height = 768;
    
                    Flag = true;
                }
  • 相关阅读:
    银行代码
    c#第二章
    c#第一章
    S1304HTML内测测试分析
    HTML第九章
    HTML第八章
    HTML第七章
    Jupyter Notebook与Jupyterhub的安装与配置
    如果你要拍一部微电影
    针对Excel的vbs操作
  • 原文地址:https://www.cnblogs.com/caok168/p/2578873.html
Copyright © 2011-2022 走看看