📄 guanli_setup.pas
字号:
unit guanli_Setup;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, StdCtrls, Mask;
type
TForm5 = class(TForm)
Button2: TButton;
DBEdit1: TDBEdit;
Label1: TLabel;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
Label2: TLabel;
DBGrid2: TDBGrid;
procedure Button2Click(Sender: TObject);
procedure ChangeFonts(OldFormWidth:integer;NewFormWidth:integer);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form5: TForm5;
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 TForm5.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 TForm5.Button2Click(Sender: TObject);
begin
Form5.Close;
end;
procedure TForm5.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 + -