winform设置文本框宽度 根据文字数量和字体返回宽度

_LinkLabel.Width = TextRenderer.MeasureText(_LinkLabel.Text, _LinkLabel.Font).Width;   
原文地址:https://www.cnblogs.com/shaomingrui/p/3556723.html