📄 fudao_setup.pas
字号:
unit Fudao_Setup;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, DBGrids, Mask, DBCtrls, ExtCtrls;
type
TForm4 = class(TForm)
Button2: TButton;
DBEdit1: TDBEdit;
Label1: TLabel;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
Label2: TLabel;
procedure Button2Click(Sender: TObject);
procedure ChangeFonts(OldFormWidth:integer;NewFormWidth:integer);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
{$R *.dfm}
uses
Data_Unit1;
type
TFooClass = class(TControl); { needed to get at protected }
{ font property }
const
ScreenWidth: LongInt = 800; {I designed my form in 800x600 mode.}
ScreenHeight: LongInt = 600;
procedure TForm4.ChangeFonts(OldFormWidth:integer;NewFormWidth:integer);
var
i: integer;
begin
NewFormWidth := longint(width) * longint(screen.width) div ScreenWidth;
for i := ControlCount - 1 downto 0 do
TFooClass(Controls[i]).Font.Size :=
(NewFormWidth div OldFormWidth) *
TFooClass(Controls[i]).Font.Size;
end;
procedure TForm4.Button2Click(Sender: TObject);
begin
Form4.Close;
end;
procedure TForm4.FormCreate(Sender: TObject);
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);
end;
ChangeFonts(ScreenWidth,width);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -