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;
                }
  • 相关阅读:
    easy-ui的data-options用法
    my_note
    定时器
    abp安装
    微信小程序
    几个免费的ui 后台
    abp创建实体的方法
    winform 开源项目
    func委托
    for update 锁行和锁表
  • 原文地址:https://www.cnblogs.com/caok168/p/2578873.html
Copyright © 2011-2022 走看看