//the point is to use the Selectedrtf property Private voidButton1_Click (Objectsender, EventArgs e) { //Mergertf-RichTextBox controls for and after contentMergertf.selectionlength =0;//do not select contentRichTextBox RTF=NewRichTextBox ();//RTF required for mergingStringBuilder s =NewStringBuilder (); //First RTF fileRtf. Text ="C # Programming"; Rtf. SelectAll (); Font F=NULL; F=NewFont ("Song Body", A, FontStyle.Bold); Rtf. SelectionFont= f;//FontRtf. SelectionColor =color.red; //JoinMergertf.selectedrtf =RTF. Selectedrtf; //a second RTF fileRtf. Text ="VB. NET Programming"; Rtf. SelectAll (); F=NewFont ("italics",Ten, Fontstyle.italic); Rtf. SelectionFont= f;//FontRtf. SelectionColor =Color.gray; //JoinMergertf.selectedrtf =RTF. Selectedrtf; //A third RTF fileRtf. Text ="United States"; Rtf. SelectAll (); F=NewFont ("blackbody", -, Fontstyle.underline | FontStyle.Bold |fontstyle.italic); Rtf. SelectionFont= f;//FontRtf. SelectionColor =Color.Blue; //JoinMergertf.selectedrtf =RTF. Selectedrtf; // Nth//.... }
How can I combine the contents of multiple RTF files in C # with an RTF file?