示例#1
0
 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);
        }