Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) Const theScreen = 1 Const theForm = 0 Private Sub Command1_Click() Call keybd_event(vbKeySnapshot, theForm, 0, 0) '若theForm改成theScreen则Copy整个Screen DoEvents Picture1.Picture = Clipboard.GetData(vbCFBitmap) End Sub
Private Declare Sub keybd_event Lib "user32" _ (ByVal bVk As Byte, _ ByVal bScan As Byte, _ ByVal dwFlags As Long, _ ByVal dwExtraInfo As Long)Private Sub Command1_Click() keybd_event vbKeySnapshot, 0&, 0&, 0& DoEvents Image1.Picture = Clipboard.GetData(vbCFBitmap) End Sub
Const theScreen = 1
Const theForm = 0
Private Sub Command1_Click()
Call keybd_event(vbKeySnapshot, theForm, 0, 0)
'若theForm改成theScreen则Copy整个Screen
DoEvents
Picture1.Picture = Clipboard.GetData(vbCFBitmap)
End Sub
(ByVal bVk As Byte, _
ByVal bScan As Byte, _
ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long)Private Sub Command1_Click()
keybd_event vbKeySnapshot, 0&, 0&, 0&
DoEvents
Image1.Picture = Clipboard.GetData(vbCFBitmap)
End Sub