Fabián Flores Vadell ha scritto:
> When I try to adjust the width of a TextBox to its content, I use
> txtSomeThing.Width = txtSomeThing.TextWidth(txtSomeThing.Text). But
> doing that, the width of TextBox never be enought to show its content
> completely.
>
> I tried to find a correction factor but this is a fallible method. How
> I can adjust exactly the width of a TextBox to its content?
>
The width of a widget refers to its outside width, including
decorations. The interior width is a different thing, sometimes called
ClientWidth; but I don't know if Gambas TextBoxes have a ClientWidth
property. The size of the decorations should be always the same (in a
given theme). I don't know how to calculate it but, supposed that this
is possible and this is "8", something like
txtSomeThing.Width = 8 + txtSomeThing.TextWidth(txtSomeThing.Text)
could work, but I am not sure.
Regards,
Doriano
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user