Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime Picturebox Paste 2

Status
Not open for further replies.

TheTuna

Programmer
Dec 13, 2002
544
US
Is there a way to do a paste into a picturebox at runtime (as there is at design time)?

A solution will earn you a great big thank you, and a star if it really, really, really solves my problem! ;) Tuna - It's fat free until you add the Mayo!
 
For a form with Picture1, set Form.KeyPreview = True to catch keypresses:

Private Sub Form_Load()
Me.KeyPreview = True
End Sub

Then process keystrokes:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = Asc("V") And Shift = vbCtrlMask Then
Set Picture1.Picture = Clipboard.GetData
End If
End Sub

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Thanks to both of you! What I was looking for was:
set picture1.picture = clipboard.getdata

I should have known this! Here are your stars! Tuna - It's fat free until you add the Mayo!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top