How to get the height of Label control in Winforms
Posted
by bmutch
on Stack Overflow
See other posts from Stack Overflow
or by bmutch
Published on 2010-02-22T19:48:39Z
Indexed on
2010/06/09
13:52 UTC
Read the original article
Hit count: 400
My label is wrapping the text due to the length of the text. The height property returns the correct value only if there is a single line. How can I get the correct height?
Thanks.
Solution: I was creating the label dynamically and checking the height then. Later the panel on which the label was residing was added to a form, changing the panel's font and thus also changing the label's font and height.
© Stack Overflow or respective owner