Z zgh777 Unregistered / Unconfirmed GUEST, unregistred user! 2008-08-17 #1 怎样自己控制一个菜单项的显示,OnMeasureItem和OnDrawItem这两个触发事件要怎样写,最好能提供实例,谢谢!!!
H hanpengshan_00 Unregistered / Unconfirmed GUEST, unregistred user! 2008-08-19 #2 设置OwnerDraw := true; 写OnDrawItem事件 procedure DrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; Selected: Boolean); begin ACanvas.FillRect(ARect); //调用TCanvas的画图,画字方法在ARect范围内画你想要的东西 //ACanvas.TextOut //ACanvas.Draw end;
设置OwnerDraw := true; 写OnDrawItem事件 procedure DrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; Selected: Boolean); begin ACanvas.FillRect(ARect); //调用TCanvas的画图,画字方法在ARect范围内画你想要的东西 //ACanvas.TextOut //ACanvas.Draw end;