<div dir="ltr"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">Il giorno lun 3 set 2018 alle ore 09:43 Me <<a href="mailto:adamnt42@gmail.com">adamnt42@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In the back of my mind there is a tiny hope that some time ago someone had a way to (approximately) work out whether..<br>
"Will this string fit into the current control width?"<br>
<br>
Anyone out there with a good memory?<br>
<br>
tia<br>
b<br></blockquote><div><br></div><div>Do you mean something like this?</div><div><br></div><div>Private $sString As String = "Will this string fit into the current control width?"<br><br>Public Sub Form_Open()<br><br>  TextBox1.Text = $sString<br><br>End<br><br>Public Sub Form_Resize()<br><br>  Dim iWBox As Integer<br><br>  iWBox = TextBox1.W<br><br>  With TextBox1<br>    While .Font.TextWidth($sString) + 16 > iWBox<br>      .Font.Size -= 0.1<br>    Wend<br>  End With<br><br>End</div><div><br></div><div>Regards</div><div>Gianluigi<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
</blockquote></div></div></div></div>