[Gambas-user] Control widths, fonts, desktop scales, strings and a bad memory

Gianluigi bagonergi at gmail.com
Mon Sep 3 12:52:36 CEST 2018


Il giorno lun 3 set 2018 alle ore 11:36 Benoît Minisini <g4mba5 at gmail.com>
ha scritto:

> 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
>
>
I meant that.
See attached file

Regards
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180903/bc078f04/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TextBoxTest-0.0.1.tar.gz
Type: application/gzip
Size: 11584 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180903/bc078f04/attachment.gz>


More information about the User mailing list