tabcontrol的alignment属性设置成Right时,tabPage的text内容怎么显示成竖着的字体

亲自测试过,成功。

 

 

private   Rectangle   tabArea; 
private   RectangleF   tabTextArea   ; 
private   void   frmopen_Load(object   sender,   System.EventArgs   e) 
{ 
this.tabControl1.DrawMode   =   TabDrawMode.OwnerDrawFixed;   
} 
private   void   tabControl1_DrawItem(object   sender,   System.Windows.Forms.DrawItemEventArgs   e) 
{ 
tabArea   =   tabControl1.GetTabRect(e.Index);   
tabTextArea   =   RectangleF.op_Implicit(tabControl1.GetTabRect(e.Index));   
Graphics   g   =   e.Graphics;   
StringFormat   sf   =   new   StringFormat();   
sf.LineAlignment   =   StringAlignment.Center;   
sf.Alignment   =   StringAlignment.Center;   
Font   font   =   this.tabControl1.Font   ;   
SolidBrush   brush   =   new   SolidBrush(Color.Black);   
g.DrawString(((TabControl)(sender)).TabPages[e.Index].Text,   font,   brush,   tabTextArea,   sf);   
}

 

 

 

posted @ 2010-12-13 06:46  googlegis  阅读(316)  评论(0编辑  收藏  举报

坐标合肥,非典型GIS开发人员 GitHub