閺€鎯版 (0) +1 鐠э拷 (0) +1 闊拷 (0) +1
閺€鎯版閹存劕濮�閺屻儳婀呴弨鎯版>>

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

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


  SetRect(TextRect, ARect.Left+24, ARect.Top+3, ARect.Right, ARect.Bottom);
  DrawText(ACanvas.Handle, PChar(str), Length(str), TextRect, DT_LEFT);
  str := ShortCutToText(TMenuItem(Sender).ShortCut);
  SetRect(TextRect, ARect.Left+24, ARect.Top+3, ARect.Right-10, ARect.Bottom);
  DrawText(ACanvas.Handle, PChar(str), Length(str), TextRect, DT_RIGHT);
  //
  if TMenuItem(Sender).Checked then
  begin
  ACanvas.Font.Charset := DEFAULT_CHARSET;
  ACanvas.Font.Name := 'Webdings';
  if TMenuItem(Sender).RadioItem then
  ACanvas.TextOut(ARect.Left+4, ARect.Top, '=')
  else
  begin
  ACanvas.Font.Height := -16;
  ACanvas.TextOut(ARect.Left+2, ARect.Top, 'a');
  end;
  end;
  end;
  //绘制图片
  ImageList := TMenuItem(Sender).GetImageList;
  if ImageList<>nil then
  if (odSelected in State) and not(odGrayed in State) then
  ImageList.Draw(ACanvas, ARect.left+2, ARect.Top+2, TMenuItem(Sender).ImageIndex)
  else
  ImageList.Draw(ACanvas, ARect.left+3, ARect.Top+3,
  TMenuItem(Sender).ImageIndex, TMenuItem(Sender).Enabled);
  end;

 


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:
键盘也能翻页,试试“← →”键

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品
閹靛婧€鐠佸潡妫�閸ョ偛鍩屾い鍫曞劥