Autor Beitrag
lemmi
Hält's aus hier
Beiträge: 8



BeitragVerfasst: Mo 18.08.03 18:59 
Hallo Delphi Fans,

wie kann ich in der Komponente TMainMenu die Schriftart ändern?
Ich setze Delphi 5 Prof ein.

Danke vorab
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 18.08.03 19:16 
Selber zeichen, heißt da wohl die Devise.
Amiga-Fan
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Di 28.12.04 22:48 
was das geht nicht? Mann ist das arm :shock: Hm

Edit: falsch, es geht (aus einem anderen Forum) :

1. ownerdraw von mainmenu auf true setzen
2. in methode ondrawitem folgendes schreiben:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
procedure TMainFormEmuBase.Verwalten1DrawItem(Sender: TObject;
  ACanvas: TCanvas; ARect: TRect; Selected: Boolean);
var
  CheckChar : Char;
begin
  ACanvas.Font.Name    := 'Courier New';
  ACanvas.Font.Size    := 15;
  ACanvas.Font.Style   := [fsBold];
  if Selected then
    ACanvas.Font.Color   := clHighLightText
  else
    ACanvas.Font.Color   := clBlack;
  CheckChar := ' ';
  with Sender as TMenuItem do
  begin
    if Checked then
      CheckChar := 'X';
    if not Enabled then
      ACanvas.Font.Color := clBtnShadow;
    ACanvas.TextRect(ARect,aRect.Left,aRect.Top,CheckChar + ' ' + Caption);
  end;
end;


:)

Edit2: war das wohl mit selbst zeichnen gemeint? Egal.. Die Schriftbreite passt noch nicht...