I Need An Option For Knowing How Much Lines There Is In TextBox

Hi, I Have An App With A Simple TextBox
Now I Want To Know How Much Lines There Is
For Being Able To Make The Height Bigger
So All The Lines Are Shown
unfortunately There Is No Option For That
Any Option With Or Without Extensions Is Welcomed
Thanks For Help

Just set its height to automatic, it will resize itself.

1 Like

Just count how many \n there are on the textbox

@Robert Ya But I Have That Textbox In An Arrangement With Height Sets To 10 Percent
@almeidapablo Sorry I Didn’t Undestand What’s “\n”
I Have Found A Little Get Around With That
I Have Created A Label WIth The Same Font Size And Every Time I Change The TextBox
I Get The Text To The Label, Get’s It’s Height And And Passes It To The Arrangement The Textbox In It

1 Like

\n is the invisible character which make break the line, the famous “Enter”

So You Say If I Type Text in TextBox With Enter (And Multiline)
And In The Text Value Search “\n” It Will Gave Me The Number Of Enters?

what about you trying it
let us know, what you find out…

1 Like

It’s Half Worked, It’s Yes Detect The Number Of Enters
But When I Needed To Convert Them To Height It’s Got Problems
The Reason Is That Not Every Line There’s The Same Height
So If I Multiply The Number Of Enters With 27 (What Was Most Close)
It’s After 4 Lines To Make More Height Than Needed
In The Start The Height It’s Really 27 But Every Line
Need Less And Less Than That 27

which means, the original question “how much lines are there in a textbox” is answered
it seems to be, you have another question now…
you might want to elaborate… also a screenshot could help others to understand, what exactly you are talking about…



Hi Thanks For Answering
Here You Can See The Code, It’s Split “\n” To Get Num Of Enter And Then Double 27 For TextBox Height

Link For All The Images: Album — Postimage.org

First Image It’s WIthout Enters

Second Image It’s With 1 Enter

Third Image It’s With 2 Enters

Look That Every Enter Thats Added And Doubles By 27 Does Not Enough In The First Enter But Too Much In All The Following

Notice The Above Space And Below Space In The Text Box Height In The Forth Image And What it’s Really Need By The Text

1 Like

Pls help me with imges