Vb Count of lines multi-text box Follow

0
Avatar
Wahyu Indrajaya

My Vb skills are very basic Can anyone help me, i want to count the number of lines from a Multi textbox. I really appreciate the slightest support.

6 comments

0
Avatar
Bruse Tai
Moderator
Comment actions Permalink

Hi Wahyu,

Thank you for the posting.

Excuse me that the requirement is not pretty clear, could you provide a clear example of your requirement?

0
Avatar
Wahyu Indrajaya
Comment actions Permalink

So I have a sentence in multiline. with a width of 50mm and a variable length - depending on the count of words.

can you help me to build a script that can count the number of lines in the multiline / or better if it can display the length of the multiline text object.

0
Avatar
Adam Flores Sr
Comment actions Permalink

I still don't understand what you are trying to accomplish,

Do you have a format with a sample data field?

try taking a snapshot of the layout with a sample of data in the parragraph

and filled with the lines you wish to display.

for now as far as i know you will need to insert a vbCrLf (Carriage Return)

at the end of each line and count how many Carriage return code are found in there.

A picture is worth a 1000 words.

We will be waiting for your screen sample.

 

Regards

Adem Flores Sr.

0
Avatar
K T
Comment actions Permalink

I also asked the BT service support for this question, but I got no answer. Now I calculate the width of each character first and then determine where to wrap the line to calculate the number of lines.

Please forgive me for my poor English!

0
Avatar
Wahyu Indrajaya
Comment actions Permalink

 

Hi bruse and adam
thankyou for the response. I don't know how to add an image to a comment, so I'll provide a link to the sample text.

so is there a vb script to calculate the height of the textbox or the number of lines of sentences in the textbox?

0
Avatar
Adam Flores Sr
Comment actions Permalink

Hi KT

Keep in mind that fonts are variable width Like the "W" is wider than "I" and because of this the amount of characters that will fit in each paragraph line

will be different,

I sometimes use a mono-spaced font like Courier New in which each character has the same space, that will give you a constant character width per character and should be able to fit the same amount of characters per line.

Hope this helps you achieve your goal.

Regards,

 

Please sign in to leave a comment.