我在label字体大小不变的情况下能改变字间距吗?
若可以,具体如何实现?

解决方案 »

  1.   

    Sample code as follows:
    --------Use it in your label's paint event
    Graphics gLable = yourLabel.CreateGraphics();
    StringFormat sfLabel = new StringFormat();
    sfLabel.Alignment = StringAlignment.Near;
    sfLabel.FormatFlags |= StringFormatFlags.FitBlackBox;//See it detail in msdn// Draw string fit to your label bound.
    gLabel.DrawString( yourLabel.Text, 
                 yourLabel.Font, 
                 new brush( yourLabel.BackColor),
                 new rectangle( 0, 0, yourLabel.Width, yourLabel.Height ),
                 sfLabel );