Tag Archives: paste

Copy files to the clipboard in C#

The example Paste files from the clipboard in C# shows how a program can paste files from the clipboard. You can copy the files to the clipboard by selecting them in Windows Explorer and pressing Ctrl+C. This example shows how … Continue reading

Posted in clipboard, interoperability | Tagged , , , , , , , , , , , | Leave a comment

Paste files from the clipboard in C#

It’s a bit harder to paste files from the clipboard than it is to paste text. Copying and pasting text is relatively straightforward. See Copy and paste text to and from the clipboard C#. When you copy files to the … Continue reading

Posted in clipboard, interoperability | Tagged , , , , , , , , , , , , | 1 Comment

Copy and paste scribble data in C#

The example Save and restore pictures drawn by the user in C# shows how to make a simple drawing program. The example Copy and paste objects to the clipboard in C# shows how to copy objects to the clipboard. This … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , | 2 Comments

Select parts of a scaled image in a PictureBox with different SizeMode values in C#

This example shows how you can select parts of a scaled image that has been stretched by a PictureBox. The example Copy, cut, and paste parts of an image to the clipboard in C# works okay if the PictureBox has … Continue reading

Posted in clipboard, graphics, image processing | Tagged , , , , , , , , , , , , , , , , , , | 5 Comments

Copy and paste data in multiple formats to the clipboard in C#

This example shows how to copy and paste data in multiple formats to the clipboard. It saves data in Rich Text (RTF), text, and HTML formats. When you paste the data, it separately displays each of those formats that are … Continue reading

Posted in clipboard | Tagged , , , , , , , , , , , | 4 Comments

Copy and paste objects to the clipboard in C#

It’s pretty easy to copy and paste objects to the clipboard in C#. The only real trick is to decorate the class that you want to use with the Serializable attribute. That allows the clipboard to serialize and deserialize instances … Continue reading

Posted in clipboard | Tagged , , , , , , , , | 3 Comments

Paste a PNG format image with a transparent background from the clipboard in C#

Sometimes you may want to paste a PNG format image into your program. The clipboard provides a simple ContainsImage method to decide whether the clipboard contains image data and a simple GetImage method to get that image if it is … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , , , , , , | Leave a comment

Copy, cut, and paste parts of an image to the clipboard in C#

The first step in copying, cutting, or pasting an image to the clipboard is to use a rubber band box to select the part of the image to manipulate. This example lets you use a rubber band box to select … Continue reading

Posted in clipboard, graphics, image processing | Tagged , , , , , , , , , , , , , , | 9 Comments

Copy and paste text to and from the clipboard C#

Using the clipboard to copy and paste text is simple. Use the Clipboard object’s SetText method to copy text to the clipboard as in the following code. // Copy text to the clipboard. private void btnCopy_Click(object sender, EventArgs e) { … Continue reading

Posted in clipboard | Tagged , , , , , , , , , , , | 2 Comments