473,386 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Hard CR/LF wordwrap in textbox ??

Hi all,

Is it possible to force a multiline textbox to insert a hard cr/lf when
wordwrapping ??

What I would like is to get a string array from the textbox representing
exactly how the text appears in the box.

ie if I type in "hello there everyone" and the textbox wraps it over 2
lines, I want to get an array containing the 2 strings..

"hello there"
"everyone"

Can this be done with a standard textbox ?? Or is there a function that can
take a string and wrap it to a specified length and return an array ??

thanks in advance
Steve

Nov 21 '05 #1
6 7082
Steve,

Strange, this is the normal behaviour in my opinion from a multiline
textbox.

A singleline sees it as one line while with a multiline it is usable with
lines and even processable as that.

http://msdn.microsoft.com/library/de...ilinetopic.asp

I hope this helps

Cor
"Steve" <@> schreef in bericht
news:42**********************@news.optusnet.com.au ...
Hi all,

Is it possible to force a multiline textbox to insert a hard cr/lf when
wordwrapping ??

What I would like is to get a string array from the textbox representing
exactly how the text appears in the box.

ie if I type in "hello there everyone" and the textbox wraps it over 2
lines, I want to get an array containing the 2 strings..

"hello there"
"everyone"

Can this be done with a standard textbox ?? Or is there a function that
can take a string and wrap it to a specified length and return an array ??

thanks in advance
Steve

Nov 21 '05 #2

"Cor Ligthert" <no************@planet.nl> wrote in message
news:Oc*************@TK2MSFTNGP14.phx.gbl...
Steve,

Strange, this is the normal behaviour in my opinion from a multiline
textbox.

A singleline sees it as one line while with a multiline it is usable with
lines and even processable as that.

http://msdn.microsoft.com/library/de...ilinetopic.asp


Hi Cor,

the textbox.lines property only splits the text into individual strings when
there are cr/lf characters typed by the user (ie they hit enter).

When the textbox wraps a long line onto second line, it does not add cr/lf
chars. When you check textbox.lines there is only one long string in the
array.
The wrapping is just done as it is displayed.

I would like to get a string array that represents exactly what the text
looks like in the box, after it has been wrapped.

thanks
Steve
Nov 21 '05 #3
Steve,

I don't know this in a simple way.

Cor
Nov 21 '05 #4
"Steve" <@> schrieb:
ie if I type in "hello there everyone" and the textbox wraps it over 2
lines, I want to get an array containing the 2 strings..


VB6 code (must be converted in order to be used in VB.NET):

<URL:http://www.activevb.de/tipps/vb6tipps/tipp0098.html>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #5

"Cor Ligthert" <no************@planet.nl> wrote in message
news:e9**************@TK2MSFTNGP15.phx.gbl...
Steve,

I don't know this in a simple way.


thanks anyway Cor

Steve
Nov 21 '05 #6

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
"Steve" <@> schrieb:
ie if I type in "hello there everyone" and the textbox wraps it over 2
lines, I want to get an array containing the 2 strings..


VB6 code (must be converted in order to be used in VB.NET):

<URL:http://www.activevb.de/tipps/vb6tipps/tipp0098.html>


thanks Herfried. I will look into this

Steve
Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: lawrence | last post by:
When users enter urls or other long strings it can destroy the formatting of a page. A long url, posted in a comment, can cause page distortions that make the page unreadable, till the website...
6
by: Pierre Jelenc | last post by:
I need to wrap text with a negative indent, that is this: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad...
0
by: Richard Back | last post by:
Hi, I would like to print the contents of a textbox to a printer, and for the text to wordwrap. The text could be more than one pages worth so I need to track the pages. I can get it to...
0
by: Mike | last post by:
Hi All, I mistakenly just posted this to the VB group. Sorry for the cross-post. I am working with a textbox in C# which pulls a set of lines (stored in the database as text_type,...
2
by: Mike | last post by:
I need my textbox to work more smoothly with respect to line breaks. When I have data pulled from the database into a textbox there are hard line breaks at the end of each line (by definition how...
1
by: louise raisbeck | last post by:
Hi there, I create a report online with basically a dump of loads of tables. One of them has 27 columns and as such it ignores the datagrid.width property and goes right along the screen in a...
4
by: the_mikado | last post by:
Hi, If this has been answered before I am sorry, but I want to wordwrap the items in a listbox so I dont have to use the horizontal scroll bar. Is this possible? if so how can it be done? ...
0
by: Kevin | last post by:
I've got a textbox on a Form in my Windows Forms program. It's Multiline and Wordwrap properties are both set to True, but the text is not wrapping. Is this a bug or is there some other setting...
4
by: AlexBur | last post by:
Hi everybody. I learn C# several month only and sometimes have problems with it. I hope somebody will help me. When wordwrap is active and i add text to the TextBox i have strange result, some...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.