我要删除delphi中TMenuItem子菜单中显示的箭头。
我尝试使用此代码。然后删除了箭头,但在第一个表示“机器人信息”的项目之后无法重绘TMenuItem。
procedure TForm1.DrawItem(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; Selected: Boolean);
var
iHeight: Integer;
dc: HDC;
begin
try
ACanvas.TextOut(ARect.Left, ARect.Top, (Sender as TMenuItem).Caption);
dc := ACanvas.Handle;
ExcludeClipRect(dc, ARect.Left, ARect.Top, ARect.Right, ARect.Bottom);
finally
ReleaseDC(0, dc);
end;
end;