Private Sub Form_Click () Const CF_BITMAP = 2 ' 定义位图各种格式。 Dim Msg ' 声明变量。 On Error Resume Next ' 设置错误处理。 Msg = "Choose OK to load a bitmap onto the Clipboard." MsgBox Msg ' 显示信息。 Clipboard.Clear ' 清除剪贴板。 Clipboard.SetData LoadPicture("PAPER.BMP") ' 取得位图。 If Err Then Msg = "Can't find the .bmp file." MsgBox Msg ' 显示错误信息。 Exit Sub End If Msg = "A bitmap is now on the Clipboard. Choose OK to copy " Msg = Msg & "the bitmap from the Clipboard to the form " MsgBox Msg ' 显示信息。 Picture = Clipboard.GetData() ' 从剪贴板上复制。 Msg = "Choose OK to clear the form." MsgBox Msg ' 显示信息。 Picture = LoadPicture() ' 清除窗体。 End Sub
在粘贴的文件夹里作判断,如果剪贴板的内容是“CopyImage”,就把那个临时文件拷屏过来。
试试吧,乱想的.
Const CF_BITMAP = 2 ' 定义位图各种格式。
Dim Msg ' 声明变量。
On Error Resume Next ' 设置错误处理。
Msg = "Choose OK to load a bitmap onto the Clipboard."
MsgBox Msg ' 显示信息。
Clipboard.Clear ' 清除剪贴板。
Clipboard.SetData LoadPicture("PAPER.BMP") ' 取得位图。
If Err Then
Msg = "Can't find the .bmp file."
MsgBox Msg ' 显示错误信息。
Exit Sub
End If
Msg = "A bitmap is now on the Clipboard. Choose OK to copy "
Msg = Msg & "the bitmap from the Clipboard to the form "
MsgBox Msg ' 显示信息。
Picture = Clipboard.GetData() ' 从剪贴板上复制。
Msg = "Choose OK to clear the form."
MsgBox Msg ' 显示信息。
Picture = LoadPicture() ' 清除窗体。
End Sub