I am trying to take text that from a TextBox control and copy it into a string that can be copied to the clipboard using ClipboardPutText(). I have word wrap turned on for my textbox for readability. The problem I am having is that I find it impossible to detect whether a new line has been formed due to word wrapping, or the user inserting a carriage return. Using GetTextBoxLine() to get a line from the textbox does not return any sort of new line information (such as a carriage return at the end if necessary). Thus when copying to the clipboard I must either insert a carriage return after each line in the text box or ignore carriage returns all together (either way, potentially messing up the intended formatting of the information). Does anybody have any hints or advice on detecting whether the next line was formed due to word wrapping or due to a carriage return?
Note I am not using an evenly spaced font (like courier) so there is no telling how many characters may be entered on a given line.
Thanks
Jonathan Rice