zoukankan      html  css  js  c++  java
  • Delphi F11 全屏

    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;
    
    type
      TForm1 = class(TForm)
        procedure FormKeyDown(Sender: TObject; var Key: Word;
          Shift: TShiftState);
      private
        { Private declarations }
      public
        { Public declarations }
        OriginalBounds: TRect;
        OriginalWindowState: TWindowState;
        ScreenBounds: TRect;
        procedure SwitchFullScreen;
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    const
      KeyF11 = 122;
    begin
      if Key = KeyF11 then SwitchFullScreen;
    end;
     
    procedure TForm1.SwitchFullScreen;
    begin
      if BorderStyle <> bsNone then begin
        // To full screen
        OriginalWindowState := WindowState;
        OriginalBounds := BoundsRect;
     
        BorderStyle := bsNone;
        ScreenBounds := Screen.MonitorFromWindow(Handle).BoundsRect;
        with ScreenBounds do
          SetBounds(Left, Top, Right - Left, Bottom - Top) ;
      end else begin
        // From full screen
        {$IFDEF MSWINDOWS}
        BorderStyle := bsSizeable;
        {$ENDIF}      
        if OriginalWindowState = wsMaximized then
          WindowState := wsMaximized
        else
          with OriginalBounds do
            SetBounds(Left, Top, Right - Left, Bottom - Top) ;
        {$IFDEF LINUX}
        BorderStyle := bsSizeable;
        {$ENDIF}  
      end;
    end;
    
    end.


  • 相关阅读:
    卷积神经网络与典型结构
    机器学习之信息熵
    机器学习读书笔记第三章(1):线性模型
    神经网络之:S型神经元
    mysql只保留一条有效数据,删除其他重复的数据
    mysql索引
    mysql自定义函数收集
    MySql中循环的使用
    WCF的例子
    C盘满了如何清理
  • 原文地址:https://www.cnblogs.com/riskyer/p/3292129.html
Copyright © 2011-2022 走看看