Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
PRB: Cannot Paste PrintScreen Result to OLE Control
Article ID: 193593 - View products that this article applies to.
This article was previously published under Q193593
Pressing the ALT+PRINTSCRN key combination turns the OLE control's PasteOK property to False, and the bitmap in the clipboard cannot be pasted to the OLE control.
There are two kinds of Clipboard formats; one is the traditional format and the other is the OLE format. Microsoft's Visual Basic OLE control is designed to hold the objects that can either be linked or embedded in the control. It requires the clipboard to contain the OLE information to be pasted into it. However, after pressing the ALT+PRINTSCRN key combination, the clipboard format is in the traditional format. For the same reason, simple metafiles in the clipboard cannot be pasted into the OLE control either.
To workaround this problem, the clipboard format needs to be transformed from traditional format to OLE format.
Steps to Reproduce and Work Around BehaviorThe following is an example of using a Rich Textbox to transform the clipboard format from traditional format to OLE format and make the paste possible. The basic idea is to paste the bitmap from the clipboard to a Rich Textbox and then copy it back from the Rich Textbox to the clipboard. In the example, the SendKeys function is used to paste to and copy from the clipboard.
Article ID: 193593 - Last Review: May 13, 2003 - Revision: 3.0