我试图将RichTextBox的整个文本复制到剪贴板。无法复制我的RichTextBox的空行
这是我在追加在RichTextBox文本:
RichTextBox1.Text += vbNewLine & AlbumName
RichTextBox1.Text += vbNewLine & AlbumLink & vbNewLine
RichTextBox1.SelectionStart = RichTextBox1.Text.Length
RichTextBox1.ScrollToCaret()
但我不能承认vbnewline(也试过用VBCrlf):
Private Sub ToolStripMenuItem2_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem2.Click
Clipboard.SetText(RichTextBox1.Text.Replace(vbNewLine, " "))
End Sub
记事本无法识别当我粘贴文本时出现空行,但如果我将相同的复制文本粘贴到其他TextEditor中,例如“SublimeText Editor”,则VBNewLine被识别...
UPDATE
使用Environment.NewLine尝试,但我得到了相同的结果。
这是从我的RichTextBox在记事本中粘贴复制的一个示例文本:
Escape the Fate - Ungrateful (2013)http://vk.com/doc3197020_179614905?hash=97855f387cf7d8a85bThe King Is Dead - Once Upon A Burning House [EP] (2013)http://vk.com/doc3197020_183005958?hash=bdea3f04fe101eae11Sleeping With Sirens - Alone [single] (2013)http://vk.com/doc3197020_182922598?hash=27e50a03a30b4ec89cPalisades - Outcasts (2013)http://vk.com/doc3197020_182588309?hash=90f629956bcfc59029Done!
这是其他编辑粘贴相同的文本:
Escape the Fate - Ungrateful (2013)
http://vk.com/doc3197020_179614905?hash=97855f387cf7d8a85b
The King Is Dead - Once Upon A Burning House [EP] (2013)
http://vk.com/doc3197020_183005958?hash=bdea3f04fe101eae11
Sleeping With Sirens - Alone [single] (2013)
http://vk.com/doc3197020_182922598?hash=27e50a03a30b4ec89c
Palisades - Outcasts (2013)
http://vk.com/doc3197020_182588309?hash=90f629956bcfc59029
Done!
你期望在记事本上看到什么? – Steve
尝试Environment.NewLine – bigcakes
@bigcake试用Environment.NewLine – ElektroStudios