Hi James,
I don't think the requirements for this project are that demanding, but
I have not been able to make it work well yet. I am using the text box
to present text that has previously been stored in the database as a
set of lines (with text type, text line sequence and text description
-- which is the actual text I need to present to be edited). The lines
can be no longer than 74 characters long in the database so I am using
courier new so that wordwrap occurs in the textbox at 75 characters.
Because the text actually has some formatting already done to it (like
below) I must maintain that for readability. I want to use the Lines
property to do a foreach loop and save the text back to the database
while attaching a line sequence and text type. Based on the
documentation for the text box I can get an array of strings (each a
line), but which has a hard line break where word wrap occurs. (like
right below)
Example one as text begins in the text box -- \r\n at end of each row
1)
Dr. Smith closed the incision at 11:43 followed by Dr. Johnson \r\n
who had not gotten any sleep in at least three days and was\r\n
dangerous when let loose......\r\n
Anesthesia Time: 2:33\r\n
The problem is if someone edits and puts in new text like in example 2.
2) Text has been added to the second line which pushes the \r\n down
into the next row
and makes the formatting messy. Surgeons hate this.
Dr. Smith closed the incision at 11:43 followed by Dr. Johnson \r\n
who had not gotten any sleep in at least three days and was
exceedingly\r\n
dangerous when let loose......\r\n
Anesthesia Time: 2:33\r\n
http://msdn.microsoft.com/library/de...linestopic.asp
I am sending a message EM_FMTLINES which does a nice job giving me line
breaks where the word wrap occurs and so I get a nice array to loop
through and save to the DB, but it still leaves the \r\n in the middle
of lines as above after 'exceedingly'. Same thing occurs when text is
deleted (i.e text below does not scoot up naturally as there may be
hard line breaks in the middle of one or more lines now).
Sorry about the length, but trying to got a good explanation.
Thanks,
Mike