wxTextCtrl width

Németh Miklós desco at bluelion.hu
Sun Oct 7 08:20:03 PDT 2007


Vadim Zeitlin írta:
> On Sat, 06 Oct 2007 02:59:10 +0200 Németh Miklós <desco at bluelion.hu> wrote:
>
> NM> How can I set the width of a TextCtrl  based on the number of characters?
>
>  You can approximate it by using GetTextWidth() on a wxDC with the same
> font as you use for the control. Of course, for a proportional font there
> is no "fixed" width really but using a string of N "W"s should give the
> upper bound, at least for texts using Latin alphabet.
>
>  Regards,
> VZ
>
>   
I thought there's an easier way ;)

desco




More information about the wx-users mailing list