 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Darko Guest
|
Posted: Mon Sep 26, 2005 6:17 pm Post subject: TMainMenu and OwnerDraw |
|
|
I draw the menuitems with this code. The accelerator keys are shown but the
combination ALT + key does not work.
When OwnerDraw is set to False everything is ok.
I work in D5.
Any help is welcome !
procedure TfrmMain.miFileDrawItem(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; Selected: Boolean);
var iOffsetLeft, iOffsetTop:integer;
begin
iOffsetLeft := 5;
iOffsetTop := 2;
with ACanvas do
begin
Pen.Style := psSolid;
Pen.Color := clBlack;
Brush.Style := bsSolid;
if Selected then
Brush.Color := $00DF967A
else
Brush.Color := $00996633;
Rectangle( ARect );
Font.Color := clWhite;
ARect.Left := ARect.Left + iOffsetLeft;
ARect.Top := ARect.Top + iOffsetTop;
DrawText(ACanvas.Handle, PChar((Sender as TMenuItem).Caption),
Length((Sender as TMenuItem).Caption), ARect, 0);
end;
end;
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|