I need to mark a TBitBtn (not TButton), that the button action requires elevation. I set ElevationRequired to True, but I do not get the shield icon.
To reproduce, place a TButton and a TBitBtn on a form:
procedure TForm1.FormCreate(Sender: TObject);
begin
Button1.ElevationRequired := True;
BitBtn1.ElevationRequired := True;
end;
Button1 is displayed with shield icon, BitBtn1 is not.
This is not possible.
A VCL
TBitBtnis an owner-drawn Win32 BUTTON control. You can see that here:Hence, a
TBitBtnis not drawn by Windows but manually by the Pascal code inVcl.Buttons.pas. Specifically,TBitBtn.DrawItem(const DrawItemStruct: TDrawItemStruct)does the painting.And here you can see that there is no mentioning of
ElevationRequired.Hence,
TBitBtndoesn't support this.In general, don't use
TBitBtn; useTButtonto get the native Win32 button.