Bonjour à tous,

Comment géré le redimensionnement d’un TForm en prenant en charge le DPI ?


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
{ Form CanResize }
procedure TFrom.FormCanResize(Sender: TObject;
  var NewWidth, NewHeight: Integer; var Resize: Boolean);
const
  AWidth = 900;
  AHeight = 550;
begin
  if NewWidth < AWidth then
    NewWidth := AWidth;
 
  if NewHeight < AHeight then
    NewHeight := AHeight;
end;
Mon Form par défaut : Height = 550, Width = 900

A l’ouverture avec le DPI : Height = 774, Width = 1339

Merci