public ToolStripItemTextRenderEventArgs (Graphics g, ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont, ContentAlignment textAlign)
: base (g, item)
{
this.text = text;
this.text_rectangle = textRectangle;
this.text_color = textColor;
this.text_font = textFont;
this.text_direction = item.TextDirection;
switch (textAlign) {
case ContentAlignment.BottomCenter:
this.text_format = TextFormatFlags.Bottom | TextFormatFlags.HorizontalCenter;
break;
case ContentAlignment.BottomLeft:
this.text_format = TextFormatFlags.Bottom | TextFormatFlags.Left;
break;
case ContentAlignment.BottomRight:
this.text_format = TextFormatFlags.Bottom | TextFormatFlags.Right;
break;
case ContentAlignment.MiddleCenter:
this.text_format = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter;
break;
case ContentAlignment.MiddleLeft:
default:
this.text_format = (TextFormatFlags.VerticalCenter | TextFormatFlags.Left);
break;
case ContentAlignment.MiddleRight:
this.text_format = TextFormatFlags.VerticalCenter | TextFormatFlags.Right;
break;
case ContentAlignment.TopCenter:
this.text_format = TextFormatFlags.Top | TextFormatFlags.HorizontalCenter;
break;
case ContentAlignment.TopLeft:
this.text_format = TextFormatFlags.Top | TextFormatFlags.Left;
break;
case ContentAlignment.TopRight:
this.text_format = TextFormatFlags.Top | TextFormatFlags.Right;
break;
}
//if ((Application.KeyboardCapture == null || !ToolStripManager.ActivatedByKeyboard) && !SystemInformation.MenuAccessKeysUnderlined)
// this.text_format |= TextFormatFlags.HidePrefix;
}