Remove carriage return character in a textbox

Oct 2 2008 11:07 PM
I have a textbox that should send any text to a server program. I have a keypress event that activates upon pressing an enter key. It sends the messages plus additional character(carriage return). How can I remove this character. I already tried using trim and replace but did not work..I also want my cursor to go back to position 0,0 of textbox. I tried Focus() and SelectionStart but I don't like the outcome. Is there a way to set the position of the cursor to row 1 col 1 after pressing enter key?

Answers (4)