⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit1.pas

📁 窗体分辨率自适应 窗体分辨率自适应 窗体分辨率自适应 窗体分辨率自适应
💻 PAS
字号:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
const
  ScreenWidth: LongInt = 800; {I designed my form in 800x600 mode.}
  ScreenHeight: LongInt = 600;

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
  fwidth, i :integer;
begin
 { fwidth :=width;
  scaled := true;
  if (screen.width <> ScreenWidth) then
  begin
    Font.Size:=(Width DIV FWidth)*Font.Size -5;
    scaleBy(screen.width, ScreenWidth);
    height := longint(height) * longint(screen.height) div ScreenHeight;
    width := longint(width) * longint(screen.width) div ScreenWidth;
  scaled :=false;  end;
  for i := ControlCount - 1 downto 0 do
    TFooClass(Controls[i]).Font.Size :=
        TFooClass(Controls[i]).Font.Size-5; }
       ScaleBy(Round(Screen.Width*100/800), 100);//自适应屏幕

end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -