public void DrawSeparatorText(RibbonItemBoundsEventArgs e, RibbonSeparator sep) { using (Brush b = new SolidBrush(GetTextColor(sep.Enabled))) { e.Graphics.DrawString(sep.Text, new Font(sep.Owner.Font, FontStyle.Bold), b, e.Bounds); } }
public void DrawSeparator(Graphics g, RibbonSeparator separator) { if (separator.SizeMode == RibbonElementSizeMode.DropDown) { if (!string.IsNullOrEmpty(separator.Text)) { using (SolidBrush b = new SolidBrush(ColorTable.SeparatorBg)) { g.FillRectangle(b, separator.Bounds); } using (Pen p = new Pen(ColorTable.SeparatorLine)) { g.DrawLine(p, new Point(separator.Bounds.Left, separator.Bounds.Bottom), new Point(separator.Bounds.Right, separator.Bounds.Bottom)); } } else { using (Pen p = new Pen(ColorTable.DropDownImageSeparator)) { g.DrawLine(p, new Point(separator.Bounds.Left + 30, separator.Bounds.Top), new Point(separator.Bounds.Right, separator.Bounds.Top)); } } } else { using (Pen p = new Pen(ColorTable.SeparatorDark)) { g.DrawLine(p, new Point(separator.Bounds.Left, separator.Bounds.Top), new Point(separator.Bounds.Left, separator.Bounds.Bottom)); } using (Pen p = new Pen(ColorTable.SeparatorLight)) { g.DrawLine(p, new Point(separator.Bounds.Left + 1, separator.Bounds.Top), new Point(separator.Bounds.Left + 1, separator.Bounds.Bottom)); } } }