正在阅读:Delphi实用代码:自绘XP风格菜单Delphi实用代码:自绘XP风格菜单

2004-08-26 10:08 出处:CSDN 作者:nhconch 责任编辑:linjixiong


  PenColor := SubMenuGrayedBackColor;
  end
  else
  if odSelected in State then
  begin
  BrushColor := SubMenuSelectedBackColor;
  PenColor := SubMenuSelectedBorderColor;
  end
  else
  begin
  BrushColor := SubMenuBackColor;
  PenColor := SubMenuBackColor;
  end;
  ACanvas.Brush.Color := BrushColor;
  ACanvas.Pen.Color := PenColor;
  ACAnvas.Rectangle(ARect);
  if not(odSelected in State) or (odGrayed in State) then
  begin
  ACanvas.Brush.Color := SubMenuBorderColor;
  ACanvas.FillRect(Rect(ARect.Left, ARect.Top, ARect.Left+20, ARect.Bottom));
  end;
  //绘文字和快捷键
  if TMenuItem(Sender).IsLine then
  begin
  ACanvas.Brush.Color := SubMenuLineColor;
  ACanvas.Pen.Color := SubMenuLineColor;
  ACanvas.FillRect(Rect(ARect.Left+23, ARect.Top+(ARect.Bottom-ARect.Top) div 2-1,
  ARect.Right-2, ARect.Top+(ARect.Bottom-ARect.Top) div 2));
  end
  else
  begin
  ACanvas.Brush.Style := bsClear;
  if odGrayed in State then
  ACanvas.Font.Color := clBtnShadow
  else
  ACanvas.Font.Color := clBlack;
  str := TMenuItem(Sender).Caption;

 


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:

键盘也能翻页,试试“← →”键

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品