Click here to Skip to main content
15,901,205 members
Home / Discussions / C#
   

C#

 
GeneralRe: view control binding Pin
HahnTech25-Nov-04 4:57
HahnTech25-Nov-04 4:57 
GeneralWindows Forms Focus Pin
Alex Leshinsky24-Nov-04 15:10
Alex Leshinsky24-Nov-04 15:10 
GeneralRe: Windows Forms Focus Pin
Alex Leshinsky25-Nov-04 13:46
Alex Leshinsky25-Nov-04 13:46 
GeneralRe: Windows Forms Focus Pin
Jay Shankar25-Nov-04 16:55
Jay Shankar25-Nov-04 16:55 
GeneralRe: Windows Forms Focus Pin
Alex Leshinsky25-Nov-04 21:17
Alex Leshinsky25-Nov-04 21:17 
GeneralRe: Windows Forms Focus Pin
Jay Shankar25-Nov-04 21:26
Jay Shankar25-Nov-04 21:26 
GeneralRe: Windows Forms Focus Pin
Alex Leshinsky26-Nov-04 11:09
Alex Leshinsky26-Nov-04 11:09 
GeneralRestoring Previous Clipboard Data Pin
Jay Shankar24-Nov-04 13:49
Jay Shankar24-Nov-04 13:49 
I am pasting image in a richTextBox using clipboard.

It works fine. But I want to restore the previous clipped data.

Any clue, How to go for it? The code I am using for trial is, as below
private void PasteImg(RichTextBox richTextBox1, string imageFileName)
{


	//Copy the previous clipped data
	System.Windows.Forms.DataObject prevDat = new DataObject();



	prevDat.SetData(Clipboard.GetDataObject());
	//
	
        #region Pasting the image
	if("" == imageFileName) imageFileName = @"c:\JayShared\music.bmp";
	

	Bitmap myBitmap = new Bitmap(file);


	// Copy the bitmap to the clipboard.
	Clipboard.SetDataObject(myBitmap, false);
	

	// Get the format for the object type.
	DataFormats.Format myFormat = DataFormats.GetFormat (DataFormats.Bitmap);
	

	// After verifying that the data can be pasted, paste
	if(richTextBox1.CanPaste(myFormat)) 
	{
		richTextBox1.Paste();
	}



	#endregion Pasting the image



	//
	//paste back the previous clipped data to the clipboard

	Clipboard.SetDataObject(prevDat, true);
	

	//
}

GeneralRe: Restoring Previous Clipboard Data Pin
Heath Stewart24-Nov-04 14:33
protectorHeath Stewart24-Nov-04 14:33 
GeneralRe: Restoring Previous Clipboard Data Pin
Jay Shankar24-Nov-04 23:04
Jay Shankar24-Nov-04 23:04 
GeneralRe: Restoring Previous Clipboard Data Pin
Heath Stewart25-Nov-04 5:40
protectorHeath Stewart25-Nov-04 5:40 
GeneralRe: Restoring Previous Clipboard Data Pin
Jay Shankar25-Nov-04 16:41
Jay Shankar25-Nov-04 16:41 
GeneralRe: Restoring Previous Clipboard Data Pin
Heath Stewart25-Nov-04 19:44
protectorHeath Stewart25-Nov-04 19:44 
GeneralRe: Restoring Previous Clipboard Data Pin
Jay Shankar25-Nov-04 20:48
Jay Shankar25-Nov-04 20:48 
GeneralRe: Restoring Previous Clipboard Data Pin
Dennis C. Dietrich24-Nov-04 14:35
Dennis C. Dietrich24-Nov-04 14:35 
GeneralRe: Restoring Previous Clipboard Data Pin
Jay Shankar24-Nov-04 23:06
Jay Shankar24-Nov-04 23:06 
GeneralDynamic Classes and Intellisense Pin
tteta@visioncore.com24-Nov-04 13:00
tteta@visioncore.com24-Nov-04 13:00 
GeneralRe: Dynamic Classes and Intellisense Pin
leppie25-Nov-04 1:38
leppie25-Nov-04 1:38 
GeneralRe: Dynamic Classes and Intellisense Pin
Heath Stewart25-Nov-04 19:41
protectorHeath Stewart25-Nov-04 19:41 
General[Easy] Remoting Pin
Snowjim24-Nov-04 12:52
Snowjim24-Nov-04 12:52 
GeneralRe: [Easy] Remoting Pin
Snowjim24-Nov-04 22:36
Snowjim24-Nov-04 22:36 
Generalquickest and easiest way to share data (C dll & .net dll) Pin
Anonymous24-Nov-04 11:03
Anonymous24-Nov-04 11:03 
GeneralRe: quickest and easiest way to share data (C dll & .net dll) Pin
Nick Parker24-Nov-04 11:08
protectorNick Parker24-Nov-04 11:08 
GeneralRe: quickest and easiest way to share data (C dll & .net dll) Pin
asaddsada24-Nov-04 11:53
sussasaddsada24-Nov-04 11:53 
Generalweb services update database using dataset Pin
Don Jonathan24-Nov-04 11:00
sussDon Jonathan24-Nov-04 11:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.