-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathunit3.pas
More file actions
58 lines (37 loc) · 1000 Bytes
/
unit3.pas
File metadata and controls
58 lines (37 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
unit Unit3;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ Tpingtrace }
Tpingtrace = class(TForm)
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
private
public
end;
var
pingtrace: Tpingtrace;
implementation
{$R *.lfm}
{ Tpingtrace }
procedure Tpingtrace.FormCreate(Sender: TObject);
var
ScreenWidth, ScreenHeight: Integer;
FormWidth, FormHeight: Integer;
begin
// Get the screen width and height
ScreenWidth := Screen.Width;
ScreenHeight := Screen.Height;
// Calculate the form size as 70% of the screen size
FormWidth := Round(ScreenWidth * 0.5);
FormHeight := Round(ScreenHeight * 0.7);
// Set the form's width and height
Width := FormWidth;
Height := FormHeight;
// Optionally, center the form on the screen
Left := (ScreenWidth - FormWidth) div 2;
Top := (ScreenHeight - FormHeight) div 2;
end;
end.