I tried -2, label not showing its text, and If I retrieve label height after that it returns -2.
But the first method using the string utils works, but that works only after adding label to panel with setting height as some other value, then calculting actual height and changing it.
Hi gkumar,
You say that -2 doesn't work, but you didn't say what you have done.
The attached test program shows that it does work.
That's what -2 (WRAP_CONTENT) is made for.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.