protected override void OnRenderItem(RenderMenuItemEventArgs e) { using (var brush = new SolidBrush(ForeColor)) { GraphicUtils.DrawCenteredText( e.Graphics, Text, e.Font, Rectangle.FromLTRB(e.Rectangle.Left + textOffsetLeft, e.Rectangle.Top, e.Rectangle.Right, e.Rectangle.Bottom), ForeColor, horizontal: false); } }
public void DrawItem(Graphics g, Rectangle rect, Font font) { var args = new RenderMenuItemEventArgs(g, rect, font); OnRenderItem(args); }
protected virtual void OnRenderItem(RenderMenuItemEventArgs e) { EventHandler <RenderMenuItemEventArgs> eh = RenderItem; eh?.Invoke(this, e); }