C# label AutoSize adds padding

Mar*_*rkP 7 c# text label winforms

I have a Label on a Windows.Form. I set the AutoSize property on the label to True and I noticed that when I do that, it pads the right hand side with ~5px of white background. I have the Padding property set to [0, 0, 0, 0]. Is there a way to get rid of this?

I would like to get the bounds of the label as close as possible to the text within the label.

Len*_*rri 11

当你只使用填充和边距时,没有办法.这是默认行为.

替代文字

在上面Window我已经设置了PaddingMargin[0,0,0,0].那5个像素仍在那里.

如果你设置FlatStyle = System,AutoSize = False你可以得到这个:

替代文字

在上面Window你不再有那5个像素.