Centralizar o programa
Gostaria de saber como faço para centralizar meu programa exatamente no meio da tela em qualquer resolução ....1280x1024 , 800x600.
Bacheschi
Curtidas 0
Respostas
Vinicius2k
20/03/2004
Colega,
Propriedade [color=red:69af1f4823]Position [/color:69af1f4823]= poScreenCenter...
T+
Propriedade [color=red:69af1f4823]Position [/color:69af1f4823]= poScreenCenter...
T+
GOSTEI 0
Rocsadan
20/03/2004
implementation
const
ScreenWidth: LongInt = 800;
ScreenHeight: LongInt = 600;
no oncreate
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;
const
ScreenWidth: LongInt = 800;
ScreenHeight: LongInt = 600;
no oncreate
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;
GOSTEI 0
Tarcisiojr
20/03/2004
eu prefiro assim:
procedure formPrincipal.Show;
begin
Top:=(Screen.Height div 2) - (Height div 2);
Left:=(Screen.Width div 2) - (Width div 2);
end;
procedure formPrincipal.Show;
begin
Top:=(Screen.Height div 2) - (Height div 2);
Left:=(Screen.Width div 2) - (Width div 2);
end;
GOSTEI 0