tabControl 控件问题 求一个tabControl 控件 要选项卡在左侧显示,字体是横着的,用VS2005 自己生成的控件字体都是竖着的,把Alignment属性设置成top 字体是横的,可设置成left时字体是竖着的,现在想让选项卡居左却字体是横着的,求解决方法或写好的控件。谢过。 本人邮箱[email protected] 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 tabControl先设置下列属性:Alignment: RightSizeMode: FixedDrawMode: OwnerDrawFixed ItemSize.Width: 25ItemSize.Height: 100然后再添加DrawItem事件:private void tabControl1_DrawItem(object sender, DrawItemEventArgs e){ Graphics g = e.Graphics; Brush _TextBrush; // Get the item from the collection. TabPage _TabPage = tabControl1.TabPages[e.Index]; // Get the real bounds for the tab rectangle. Rectangle _TabBounds = tabControl1.GetTabRect(e.Index); if(e.State == DrawItemState.Selected) { // Draw a different background color, and don't paint a focus rectangle. _TextBrush = new SolidBrush(Color.Red); g.FillRectangle(Brushes.Gray, e.Bounds); } else { _TextBrush = new System.Drawing.SolidBrush(e.ForeColor); e.DrawBackground(); } // Use our own font. Because we CAN. Font _TabFont = new Font("Arial", 10, FontStyle.Bold, GraphicsUnit.Pixel); // Draw string. Center the text. StringFormat _StringFlags = new StringFormat(); _StringFlags.Alignment = StringAlignment.Center; _StringFlags.LineAlignment = StringAlignment.Center; g.DrawString(_TabPage.Text, _TabFont, _TextBrush, _TabBounds, new StringFormat(_StringFlags));}http://en.csharp-online.net/TabControl DataSet删除列 朋友写的一个sys,在C#不会调用。。。 如何将ORACLE字段显示到我指定的位置呢?求帮助 收藏 不显示删除回复显示所有回复显示星级回复显示得分回复 如何保证程序能在手机待机状态下继续工作? c#发短信,我是用短信猫 There is no row at position 0是什么问题(解决立刻给分)??? config文件的一个小问题。 C#控制Word打开文档后,如何设置文档不可编辑? 如何从已存在的文本文件内容前面添加东西? power designer9.5的Report模板,不知道是否在这? C#向sdf本地数据库插入数据 怎样让ListView背景透明
Alignment: Right
SizeMode: Fixed
DrawMode: OwnerDrawFixed
ItemSize.Width: 25
ItemSize.Height: 100然后再添加DrawItem事件:private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)
{
Graphics g = e.Graphics;
Brush _TextBrush;
// Get the item from the collection.
TabPage _TabPage = tabControl1.TabPages[e.Index];
// Get the real bounds for the tab rectangle.
Rectangle _TabBounds = tabControl1.GetTabRect(e.Index);
if(e.State == DrawItemState.Selected)
{
// Draw a different background color, and don't paint a focus rectangle.
_TextBrush = new SolidBrush(Color.Red);
g.FillRectangle(Brushes.Gray, e.Bounds);
}
else
{
_TextBrush = new System.Drawing.SolidBrush(e.ForeColor);
e.DrawBackground();
}
// Use our own font. Because we CAN.
Font _TabFont = new Font("Arial", 10, FontStyle.Bold, GraphicsUnit.Pixel);
// Draw string. Center the text.
StringFormat _StringFlags = new StringFormat();
_StringFlags.Alignment = StringAlignment.Center;
_StringFlags.LineAlignment = StringAlignment.Center;
g.DrawString(_TabPage.Text, _TabFont, _TextBrush,
_TabBounds, new StringFormat(_StringFlags));
}
http://en.csharp-online.net/TabControl