[Gambas-user] Control widths, fonts, desktop scales, strings and a bad memory
Benoît Minisini
g4mba5 at gmail.com
Mon Sep 3 11:35:54 CEST 2018
Le 03/09/2018 à 09:42, Me a écrit :
> In the back of my mind there is a tiny hope that some time ago someone had a way to (approximately) work out whether..
> "Will this string fit into the current control width?"
>
> Anyone out there with a good memory?
>
> tia
> b
>
>
You can't, because you can't know where a control draws its text, how it
draws it, and if it has a border, inner padding, and so on.
Some controls have an AutoResize property to deal with that for you.
Otherwise you must use the Control.Font.TextWidth() method and add some
approximate padding.
Regards,
--
Benoît Minisini
More information about the User
mailing list