想格式化一个63个像素长的字符串长度,然后往里面写实际字符串,并且右对齐,如何弄 想格式化一个63个像素长的字符串长度,然后往里面写实际字符串,并且右对齐,如何弄 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不知道能不能帮你解决这个问题,但如下的代码是我想表达的意思:protected override void OnPaint(PaintEventArgs e){ base.OnPaint(e); this.m_drawList.Draw(e.Graphics); String text1 = "text"; Font arialBold = new Font("Arial", 12.0F); Rectangle drawRect = new Rectangle(20, 20, 63, 20);//这里的大小就是像素了。 TextRenderer.DrawText(e.Graphics, text1, arialBold, drawRect, Color.Red, TextFormatFlags.Right); e.Graphics.DrawRectangle(SystemPens.ControlText, drawRect);} — 面向对象原则:多组合,少继承;低耦合,高内聚。 关于PictureBox的疑问 关于progressbar 的最大值和当前值的问题 如何在TextBox中输入的时候自动加入 - 网页播放背景音乐 还有一个按钮,请问我在按钮事件中怎么写呀 水晶报表如何显示RTF或DOC格式之类的文本或图片 請教原因何在???在線等待 请教一个调用窗体的问题 网络编程问题,谢谢 关于ComboBox的问题?谢谢! c#中dockpanel怎样使MDI子窗体平铺层叠
{
base.OnPaint(e);
this.m_drawList.Draw(e.Graphics);
String text1 = "text";
Font arialBold = new Font("Arial", 12.0F);
Rectangle drawRect = new Rectangle(20, 20, 63, 20);//这里的大小就是像素了。
TextRenderer.DrawText(e.Graphics, text1, arialBold, drawRect, Color.Red, TextFormatFlags.Right);
e.Graphics.DrawRectangle(SystemPens.ControlText, drawRect);
}