Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How do I copy a bitmap from the clipboard to a PictureBox?

This code snippet shows how you can set your PictureBox's image to be the image from the clipboard:

[C#]

pictureBox1.Image =
  (Bitmap) Clipboard.GetDataObject().GetData( DataFormats.Bitmap );

[Visual Basic]

pictureBox1.Image = _
  CType(Clipboard.GetDataObject().GetData(DataFormats.Bitmap), Bitmap)

Contributed from George Shepherd's Windows Forms FAQ



Page view counter