26 | 04 | 2017

Paste Clipboard Content to PictureBox

It's possible to paste an image from a clipboard file or clipboard image into a picturebox. Create a form with a button and a picturebox and use the code below to make it work. 

 

PictureBoxPaste

'Image of sample screen'

 

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

        If Clipboard.ContainsImage Then
            PictureBox1.Image = CType(Clipboard.GetData(System.Windows.Forms.DataFormats.Bitmap), Bitmap)
        ElseIf Clipboard.ContainsFileDropList = True Then

            PictureBox1.Load(Clipboard.GetFileDropList(0))
        End If
    End Sub

 

Login

Sign up now and upload your code to the website.

Help us to continue.....
Statistics
Articles View Hits
2234948
Latest Articles