那是因为这个根本 就没有对齐方式,本身就是对齐的,还怎么再对齐啊,
如果你想美化的话可以自己重写
参考这段[C#] 纯文本查看 复制代码 case TabAlignment.Left:
if (hasImage)
{
textRect.Height = tabRect.Height - tabRect.Width + 2;
}
g.TranslateTransform(textRect.X, textRect.Bottom); //平移
g.RotateTransform(270F); //旋转
sf = new StringFormat(StringFormatFlags.NoWrap);
sf.Alignment = StringAlignment.Center;
sf.LineAlignment = StringAlignment.Center;
sf.Trimming = StringTrimming.Character;
newTextRect = textRect;
newTextRect.X = 0;
newTextRect.Y = 0;
newTextRect.Width = textRect.Height;
newTextRect.Height = textRect.Width;
using (Brush brush = new SolidBrush(page.ForeColor))
{
g.DrawString(
page.Text,
page.Font,
brush,
newTextRect,
sf);
}
g.ResetTransform();
break; |