How can I get multilined TextBox' visual Lines ?

  • Thread starter Thread starter AlanChong
  • Start date Start date
A

AlanChong

Guest
Hello. Due to printing alignments, my program has a function that helps users to break lines with every 30 byes. I put a invisible TextBox on form. It's set to some fixed width char set. I typed in TextBox.Text 123456789012345678901234567890 and adjust the width of the TextBox so that it just fits the above text. This makes sure it will do line-break every 30 characters

For example, I had to the following text. I first replaced every line break with a space. It's then put into the the TextBox.

123456 78901234 567890 1234567890 123456 78901234
567890 1234567890 5669998 5699887 36656884 669887
669999 88877 336998 5596632544 3256998 5899644411

It showed something like this (not exactly but just for example):

123456 78901234 567890
1234567890 123456 78901234
567890 1234567890 5669998
5699887 36656884 669887
669999 88877 336998 5596632544
3256998 5899644411

After that TextBox.Count() was still 3, not 6. My code looped through TextBox.Lines and joined adjacent lines with a line break. Then the whole string was put into a DataTable's column. I examined the text in the column and discovered that the content of the column is still:

123456 78901234 567890 1234567890 123456 78901234
567890 1234567890 5669998 5699887 36656884 669887
669999 88877 336998 5596632544 3256998 5899644411

not :

123456 78901234 567890
1234567890 123456 78901234
567890 1234567890 5669998
5699887 36656884 669887
669999 88877 336998 5596632544
3256998 5899644411

I don't want the original 3-line text. I want the new after-line-break six-line text. How can I achieve that ?

Thank you very much.

Continue reading...
 
Back
Top