Wrox Programmer Forums
|
BOOK: Beginning Visual C#
This is the forum to discuss the Wrox book Beginning Visual C#, Revised Edition of Beginning C# for .NET v1.0 by Karli Watson, David Espinosa, Zach Greenvoss, Jacob Hammer Pedersen, Christian Nagel, Jon D. Reid, Matthew Reynolds, Morgan Skinner, Eric White; ISBN: 9780764543821
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 16th, 2003, 09:43 AM
Registered User
 
Join Date: Aug 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Rich text Box Problem

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(Data Formats.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.


 
Old December 16th, 2003, 10:23 AM
Authorized User
 
Join Date: Aug 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Chris Beach Send a message via AIM to Chris Beach Send a message via MSN to Chris Beach Send a message via Yahoo to Chris Beach
Default

does getdatapresent definitely return a true/false?

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

or something along those lines.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Rich Text Box aliirfan84 ASP.NET 2.0 Professional 1 February 23rd, 2007 06:35 AM
Rich Text Box spike010101 Pro VB 6 1 September 29th, 2004 02:37 AM
RICH TEXT BOX priyanka123 VB How-To 0 May 6th, 2004 01:46 PM
Printing from a rich text box snowy0 VB.NET 2002/2003 Basics 2 April 24th, 2004 10:04 AM
Saving Rich Text Box Formatting snowy0 VB.NET 2002/2003 Basics 5 February 29th, 2004 02:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.