Subject: Rich text Box Problem
Posted By: abhijeet Post Date: 12/16/2003 8:43:42 AM
I have a Rich Text Box Control. In which i want that only text along with its formatting(bold, color etc) be pasted. But it should discard IF clipboard item contains Image.
I tried using
if(!(Clipboard.GetDataObject().GetDataPresent(DataFormats.Bitmap)))
         {
            Clipboard.GetDataObject().GetFormats();
            this.Paste();
         }

but does not allow Image to be pasted but if data to be pasted contains Image and Text both it fails to restrict.
I also tried with DataFormats.Text but then only text is pasted and formatting is lost. Can anybody help me.
 
 
 

Reply By: Chris Beach Reply Date: 12/16/2003 9:23:45 AM
does getdatapresent definitely return a true/false?

if it doesn't then surely you need something like:
if((Clipboard.GetDataObject().GetDataPresent(DataFormats.Bitmap))!=DataFormats.Bitmap)

or something along those lines.


Go to topic 7596

Return to index page 985
Return to index page 984
Return to index page 983
Return to index page 982
Return to index page 981
Return to index page 980
Return to index page 979
Return to index page 978
Return to index page 977
Return to index page 976