Category Archives: clipboard

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 , , , , , , , , , , , , , , , , , , | 4 Comments

See what kinds of data are available in the clipboard and display them in C#

This example shows how you can see what kinds of data are available in the clipboard. The program’s form contains four controls that can display samples of data. They include a PictureBox, TextBox, RichTextBox, and WebBrowser. Before the WebBrowser can … Continue reading

Posted in clipboard | Tagged , , , , , , , , | 2 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 , , , , , , , , , , , | 3 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

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 , , , , , , , , , , , , , , | 7 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 , , , , , , , , , , , | Leave a comment

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 | Leave a comment

Paste files from the clipboard in C#

Copying and pasting text is relatively straightforward. See Copy and paste text to and from the clipboard C#.) When you copy files, the data copied is actually an array of strings holding the names of the files. This example shows … Continue reading

Posted in clipboard, interoperability | Leave a comment