如何设置“竖着放”的字体?

rayscici 2006-03-30 12:19:18
如:“名称”
要写成格式:名
...全文
438 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
rayscici 2006-03-31
  • 打赏
  • 举报
回复
但是我不晓得table怎么设置。从哪里可以调用?
rayscici 2006-03-31
  • 打赏
  • 举报
回复
Graphics g=e.Graphics;
string txt="汽包水位";
FontFamily ff=new FontFamily("Times New Roman");
FontStyle style=FontStyle.Regular;
Font f=new Font(ff,8,style);

StringFormat sf=new StringFormat();
sf.FormatFlags=StringFormatFlags.DirectionVertical;
g.DrawString(txt,f,new SolidBrush(Color.Blue),new Point(100,100),sf);
luojinat2005 2006-03-30
  • 打赏
  • 举报
回复
private void pictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)

{

Graphics g = e.Graphics;



g.TranslateTransform(100.0f, 100.0f);

g.RotateTransform(-90.0f);

g.DrawString("Vertical Text", Font, Brushes.Blue, 0.0f, 0.0f);

g.ResetTransform();



g.TranslateTransform(100.0f, 100.0f);

g.RotateTransform(-45.0f);

g.DrawString("Slanted Text", new Font(Font, FontStyle.Bold), Brushes.Red, 0.0f, 0.0f);

g.ResetTransform();



}
luojinat2005 2006-03-30
  • 打赏
  • 举报
回复
1.放在表格(table)中,限制表格宽度
2.加入标记<br>:名<br>称
Knight94 2006-03-30
  • 打赏
  • 举报
回复
参看
http://www.syncfusion.com/faq/windowsforms/Search/644.aspx
or
http://blog.csdn.net/knight94/archive/2006/03/25/638397.aspx
美福种田伯 2006-03-30
  • 打赏
  • 举报
回复
luojinat2005 的方法很好,改变世界坐标
zaolaotou 2006-03-30
  • 打赏
  • 举报
回复
StringFormat vertStrFormat = new StringFormat();
vertStrFormat.FormatFlags = StringFormatFlags.DirectionVertical;
g.DrawString("abcd",horzFont,horzBrush,(int)((172+k*80)*bW),(int)(242*bH),vertStrFormat);
rayscici 2006-03-30
  • 打赏
  • 举报
回复
我已想出来了,就之间用一个label控件,设置其size。

110,537

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧