Private Sub Form_Click () Const CF_BITMAP = 2 ' Define bitmap format. Dim Msg ' Declare variable. On Error Resume Next ' Set up error handling. Msg = "Choose OK to load a bitmap onto the Clipboard." MsgBox Msg ' Display message. Clipboard.Clear ' Clear Clipboard. Clipboard.SetData LoadPicture("PAPER.BMP") ' Get bitmap. If Err Then Msg = "Can't find the .bmp file." MsgBox Msg ' Display error message. 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 ' Display message. Picture = Clipboard.GetData() ' Copy from Clipboard. Msg = "Choose OK to clear the form." MsgBox Msg ' Display message. Picture = LoadPicture() ' Clear form. End Sub
Clipboard.SetText "呵呵"
Const CF_BITMAP = 2 ' Define bitmap format.
Dim Msg ' Declare variable.
On Error Resume Next ' Set up error handling.
Msg = "Choose OK to load a bitmap onto the Clipboard."
MsgBox Msg ' Display message.
Clipboard.Clear ' Clear Clipboard.
Clipboard.SetData LoadPicture("PAPER.BMP") ' Get bitmap.
If Err Then
Msg = "Can't find the .bmp file."
MsgBox Msg ' Display error message.
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 ' Display message.
Picture = Clipboard.GetData() ' Copy from Clipboard.
Msg = "Choose OK to clear the form."
MsgBox Msg ' Display message.
Picture = LoadPicture() ' Clear form.
End Sub