PDA

View Full Version : Weird C# Copy to Clipboard Problem


Rappa
11-07-2007, 02:22 AM
So i have a richTextBox that displays some code, and i have a copy button with code:

Clipboard.SetDataObject(richTextBox.Text, true);

Now the box displays text on different lines (non wrapping) and im using "\n" in my code to do this, so my problem is as follows:

When the user clicks copy and pastes it into notepad, everywhere there was a line break, theres a little box character (similiar to [] without the space), but if i copy it directly from the box with ctrl + c and paste it, i dont get this problem. Also if the user clicks copy and pastes it in Wordpad theres no problem either. So is my problem in my clipboard.setdataobject? should i be using somthing else?

Rappa
11-07-2007, 06:08 PM
Any Help would be nice..