//Graphics g = this.CreateGraphics();
//Double startingPoint = (this.Width / 2) - (g.MeasureString(this.Text.Trim(), this.Font).Width / 2);
//Double ws = g.MeasureString("*", this.Font).Width;
//String tmp = " ";
//Double tw = 0;
//while ((tw + ws) < startingPoint)
//{
// tmp += "3 ";
// tw += ws;
//}
//this.Text = tmp.Replace("3", " ") + this.Text.Trim();
c#窗体标题文本居中
最新推荐文章于 2024-06-02 21:10:08 发布