~~~~~~~~~~~~~~~~Visual C++ 2005 Express~~~~~~~~~~~~~

G

Guest

Visual C++ 2005 Express

MVP's and experience programmer's only please!...

I need to get the number of lines in a textbox so I can insert them into a
listview. The text comes from my database and is unformatted. I display the
text to my user in the listview. The textbox I create logically in the
program, and I initialize the correct properties for a normal multiline
editor.

When the user changes the column size then I reload the lines accordinally.
The problem I am having is when I get the lines property which is a
array<^>^(). The lenght is always 1 no matter how many lines are in the
textbox.

In MFC when the lines are wraped the new line character is automattically
inserted, but here it's not.

Can you help me solve this problem? I would really appreciate it!

Thanks!...
 
H

Herfried K. Wagner [MVP]

Eric said:
I need to get the number of lines in a textbox so I can insert them into a
listview. The text comes from my database and is unformatted. I display
the
text to my user in the listview. The textbox I create logically in the
program, and I initialize the correct properties for a normal multiline
editor.

When the user changes the column size then I reload the lines
accordinally.
The problem I am having is when I get the lines property which is a
array<^>^(). The lenght is always 1 no matter how many lines are in the
textbox.

In MFC when the lines are wraped the new line character is automattically
inserted, but here it's not.

I don't think there is currently a managed way to archieve what you want.
You may want to use p/invoke or according header files to archieve this
behavior. I feel sorry, but I can only provide a sample written in VB.NET:

Determining the lines as they are being displayed in a textbox control
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=textboxdisplayedlines&lang=en>

BTW: Please choose a more meaningful subject for future threads.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top