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);
     }
 }
Пример #2
0
        public void DrawItem(Graphics g, Rectangle rect, Font font)
        {
            var args = new RenderMenuItemEventArgs(g, rect, font);

            OnRenderItem(args);
        }
Пример #3
0
        protected virtual void OnRenderItem(RenderMenuItemEventArgs e)
        {
            EventHandler <RenderMenuItemEventArgs> eh = RenderItem;

            eh?.Invoke(this, e);
        }