if i copy this method:
Clipboard.SetText(richTextBox1.SelectedRtf, TextDataFormat.Rtf);
I canβt paste into notebook
if i copy this method:
Clipboard.SetText(richTextBox1.SelectedText, TextDataFormat.UnicodeText);
it works in word and notepad but inserts into a word without forming
richTextBox1.Copy();
works in Word and notepad, but I cannot change the string value.
How to copy a usually formatted string to the clipboard?
PS I found
DataObject dto = new DataObject(); dto.SetText(mesrtf, TextDataFormat.Rtf); dto.SetText(mes, TextDataFormat.UnicodeText); Clipboard.Clear(); Clipboard.SetDataObject(dto);
working
Drakosha
source share