Bonjour à tous,
Dans le cadre d'un relooking de l'appli sur laquelle je bosse, on prend le parti de lâcher le 3D des différents composants.
Il m'en reste un qui me pose problème : TBitBtn.
Pour traiter les TButton, j'ai utilisé le code suivant :
procedure TForm1.
Flatten(theControl: TWinControl
);
var dwStyle:
Longint;
begin dwStyle := GetWindowLong
(theControl.
handle, GWL_STYLE
)or BS_FLAT;
SetWindowLong
(theControl.
Handle, GWL_STYLE, dwStyle
);
end;
procedure TForm1.
FormCreate(Sender:
TObject);
var i :
Integer;
begin for i :=
0toSelf.
ComponentCount-1do begin if(Self.
Components[i
]is TButton
) or(Self.
Components[i
]is TBitBtn
)then Flatten
(Self.
Components[i
]as TWinControl
);
end;
Cela marche bien pour les composants TButton (en thème Windows classique) mais ne fait strictement rien sur le TBitBtn.
J'aurais donc deux questions :
. Dans la mesure où ces deux composants ont les mêmes héritages, pourquoi cela ne fonctionne que pour l'un d'entre eux ?
. Sauriez-vous comment rendre le TBitBtn plat ?
Merci.