A
Adam Sandler
Hello,
I have a richtextbox and a method which copies the contents of the
richtextbox to the clipboard -- like so:
Clipboard.SetText(this.richTextBox1.Text);
The problem is if there are any returns, and the user pastes the
clipboard contents into notepad, all the data appears on one line --
with a bunch of non printing characters (which show up as boxes) where
the returns should be. It works okay in wordpad though
So the desired paste operation in notepad yields this:
! 6/28/2008 10:15:58 PM netadmin<<box>>! Enable multicast
routing.<<box>>ip multicast-routing distributed<<box>>ip multicast
route-limit 1000
When I want it to yield this:
! 6/28/2008 10:15:58 PM netadmin
! Enable multicast routing.
ip multicast-routing distributed
ip multicast route-limit 1000
In the source code, the returns are put in with "\n". I tried
replacing that with Environment.NewLine and that doesn't help.
So, how can I get the contents of the clipboard copy to paste into a
text editor where returns aren't treated as special characters and the
text is formatted vertically instead of appearing all on one line?
Suggestions are greatly appreciated.
Thanks!
I have a richtextbox and a method which copies the contents of the
richtextbox to the clipboard -- like so:
Clipboard.SetText(this.richTextBox1.Text);
The problem is if there are any returns, and the user pastes the
clipboard contents into notepad, all the data appears on one line --
with a bunch of non printing characters (which show up as boxes) where
the returns should be. It works okay in wordpad though
So the desired paste operation in notepad yields this:
! 6/28/2008 10:15:58 PM netadmin<<box>>! Enable multicast
routing.<<box>>ip multicast-routing distributed<<box>>ip multicast
route-limit 1000
When I want it to yield this:
! 6/28/2008 10:15:58 PM netadmin
! Enable multicast routing.
ip multicast-routing distributed
ip multicast route-limit 1000
In the source code, the returns are put in with "\n". I tried
replacing that with Environment.NewLine and that doesn't help.
So, how can I get the contents of the clipboard copy to paste into a
text editor where returns aren't treated as special characters and the
text is formatted vertically instead of appearing all on one line?
Suggestions are greatly appreciated.
Thanks!