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);
     }
 }
Ejemplo n.º 2
0
        public void DrawItem(Graphics g, Rectangle rect, Font font)
        {
            var args = new RenderMenuItemEventArgs(g, rect, font);

            OnRenderItem(args);
        }
Ejemplo n.º 3
0
        protected virtual void OnRenderItem(RenderMenuItemEventArgs e)
        {
            EventHandler <RenderMenuItemEventArgs> eh = RenderItem;

            eh?.Invoke(this, e);
        }