📄 project1.dpr
字号:
program Project1;
uses
Forms,
Dialogs,
Classes,
TypInfo,
Windows,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
const
//I designed in 800 x 600 mode
ScreenWidth: LongInt = 800;
ScreenHeight: LongInt = 600;
var
vi_Counter1, vi_Counter2: Integer;
NewFormWidth: Integer;
begin
Application.Initialize;
Application.Title := '共享入侵';
Application.CreateForm(TForm1, Form1);
NewFormWidth := GetSystemMetrics(0);
with Application do
for vi_Counter1 := 0 to ComponentCount-1 do
begin
//Find all the Auto-create forms
if Components[vi_Counter1]is TForm then
with (Components[vi_Counter1]as TForm)do
begin
Scaled := True;
if screen.width <> ScreenWidth then
begin
Height := longint(Height)*longint(screen.Height) div
ScreenHeight;
Width := longint(Width)*longint(screen.Width) div
ScreenWidth;
ScaleBy(screen.Width, ScreenWidth);
//Now Scale the Form′s component′s Font
for vi_Counter2 := 0 to ControlCount-1 do
with Components[vi_Counter2] do
//Use RTTI information to find for a Font property
if GetPropInfo(ClassInfo, 'font')<>nil then
Font.Size := (NewFormWidth div ScreenWidth)
*font.Size;
end;
end;
end;
Application.Run;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -