Programación General > Trucos
Codigo Para Adaptar Forms A Cualquier Resolucion
hecktor00:
--- Citar ---const
ancho = 800;
alto = 600;
procedure Tform1.formcreate (sender : tobject);
begin
Height := Height *screen.height div alto;
Width := Width * sreen.width div ancho;
scaleby(screen.Width,Ancho)
end;
!suerte
--- Fin de la cita ---
marge:
hola!!
este codigo en que parte se coloca?, en el form principal?
Enko:
--- Cita de: "marge" --- hola!!
este codigo en que parte se coloca?, en el form principal?
--- Fin de la cita ---
En el Evento FormCreate como se observa en el codigo
bartolomeo:
Buenos dias:
Este codigo no solo se adapta a cualquier resolucion si no tambien a cualquier tamaño de letra, lo hice para mi caso, para el de ustedes seria facil adaptarlo.
--- Código: Text ---If Screen.PixelsPerInch = 96 then begin Height := Height *screen.height div alto; Width := Width * screen.width div ancho; scaleby(screen.Width,Ancho);end else if Screen.PixelsPerInch = 120 then begin Height := Height *screen.height div alto; Height := Height+((Height*15) div 100); Width := Width * screen.width div ancho; Width := Width+((Width*15) div 100); scaleby(screen.Width,Ancho); Top := Top - 70; Left := Left - 70;end else begin Height := Height *screen.height div alto; Width := Width * screen.width div ancho; scaleby(screen.Width,Ancho);
ushedipe:
:alien: pero se debe agregar el código a todos los formularios o sólo a uno en particular? :comp:
Navegación
[#] Página Siguiente
Ir a la versión completa