C#中如何获取一个字体的宽度值(像素单位)

     private void button1_Click(object sender, EventArgs e)
        {
            Graphics g = this.CreateGraphics();
            SizeF sizeF = g.MeasureString("A", new Font("宋体", 9));
            MessageBox.Show(sizeF.Width + " " + sizeF.Height);
            g.Dispose();
        }

你可能感兴趣的:(object,C#,button)