General information
Category:
Forms & Form designer
Sorry, I answered to fast without reading close enough.
Assuming your forms ScaleMode is set to pixels can you do something like this:
Get the width of the editbox.
Use FontMetric to get the average width for the font your using.
Multiply this average times the len(editbox.text) to get a width.
Divide this with by the number of columns (the width) in your editbox.
Round up.
>You can use MEMLINES(Editbox.Text). MEMLINES() is meant to return the number of lines in a memo field, however I'm using it(along with MEMLINE()) in some code to parse through the text in an editbox. HTH.
>
>>Is there any sample code for figuring out how many lines the current value of an EditBox is taking up, taking into account font and wrapping issues?
>>
>>I want to auto-size my editbox to as small a size as can hold the arbitrary text passed in (or optionally, is there some way to get TextBoxes to display multi-line text?).
>>
>>Thanks as always,
>>
>>-- jas
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only