Hi,
I need to change the font size or the font color of a popup menu on my form. I have gone up and down on the Internet and on this forum and I can't seem to find any working solution for my problem... I can't get the Popup Menu font size or its font name changed.
I set the OwnerDraw :=true and then assign handlers as follows.
procedure TForm1.PopupMenu1DrawItem(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; AState: TOwnerDrawState);
var
s: string;
begin
// change font
ACanvas.Font.Name := 'Times';
ACanvas.Font.Size := 20;
ACanvas.Font.Style := [fsBold];
ACanvas.Font.Color := clYellow;
// change background
ACanvas.Brush.Color := clBlack;
ACanvas.Rectangle(ARect);
// write caption/text
s := (Sender as TMenuItem).Caption;
ACanvas.TextOut(ARect.Left + 2, ARect.Top + 2 , s);
end;
And I see NO CHANGES AT ALL. Besides, I noticed that drawitem and measureitem handler is not EXECUTING at all.
Any idea.
fpc 3.2.0
laz 2.0.10