Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
actually i am using "telerik Wpf Editor",In that inbuilt insert picture property ,when user inserted picture into radrichtextbox and close the editor,i want to that picture into my richtextbox in windows form ....what can i do?
i am trying the following code:

C#
public void ExportToRtf(string filepath)
    {
        RtfFormatProvider provider = new RtfFormatProvider();
        using (FileStream docStream = new FileStream(filepath, FileMode.OpenOrCreate))
        {
            provider.Export(radRichTextBox1.Document, docStream);
            docStream.Dispose();

        }
    }


and for loadrichtextbox:
C#
public void loadrichtextbox()
     {
                 DataTable dt = new DataTable();
                 string path = "";
                 dt = objorgBAl.GetOrgDocstatus(Globalclass.Activedatabase);
                 if (dt.Rows.Count > 0)
                 {
                     if (dt.Rows[0]["DocCurrentStatus"].ToString() == "New" || dt.Rows[0]["DocCurrentStatus"].ToString() == "Approve" || dt.Rows[0]["DocCurrentStatus"].ToString()=="")
                     {
                         path = Globalclass.Activedatabase + objrootpath.DefaultOrgDocPath + "Missionandversion.rtf";
                         btnEditVision.Visible = true;
                         pnlLock.Visible = false;
                     }
                     else
                     {
                         path = Globalclass.Activedatabase + objrootpath.DefaultOrgDocPath + "Missionandversion_Lck.rtf";
                         pnlLock.Visible = true;
                         btnEditVision.Visible = false;
                     }
                 }
                 else
                 {
                     path = Globalclass.Activedatabase + objrootpath.DefaultOrgDocPath + "Missionandversion.rtf";
                     btnEditVision.Visible = true;
                     pnlLock.Visible = false;
                 }
                 if (File.Exists(path))
                 {
                     using (System.IO.FileStream streamRTF = new System.IO.FileStream(path, System.IO.FileMode.Open))
                     {
                         richTextBoxVision.LoadFile(streamRTF, RichTextBoxStreamType.RichText);
                         streamRTF.Dispose();
                     }
                 }
         }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900