Ikke
Ikke

Reputation: 101261

Labelsize appears bigger in VB.Net

I'm trying to stack a few lists on top of each other. But the label.size.height appears to be bigger then the label itself.

When i set the borderstyle to fixedsingle, i see the border around the text. But the height is bigger, so there comes a space between one label and the next.

I have tried to set margin and padding to 0 without result.

Exemple: label.size.height return 23, when the height actually is something around 15.

Does someone knows how i get the right size?

Edit: When i explicitly set the height of the lable, the problem is solved. Is this some problem with autosize?

Upvotes: 0

Views: 164

Answers (1)

NileshChauhan
NileshChauhan

Reputation: 5569

I had encounter this kind of problem earlier. The label height oscillated between 17 and 23. But, my labels were placed inside a TableLayoutPanel and so how I fixed it :), by making changes in Designer.cs

HTH

Upvotes: 1

Related Questions