Private Sub Form_Click ()
Dim Entry, I, Msg ' 声明变量。
Msg = "Choose OK to add 100 items to your list box."
MsgBox Msg ' 显示信息。
For I = 1 To 100 ' 计数值从 1 到 100。
Entry = "Entry " & I ' 创建输入项。
List1.AddItem Entry ' 添加该输入项。
Next I
Msg = "Choose OK to remove every other entry."
MsgBox Msg ' 显示信息。
For I = 1 To 50 ' 确定如何
List1.RemoveItem I ' 每隔一项
Next I ' 删除。
Msg = "Choose OK to remove all items from the list box."
MsgBox Msg ' 显示信息。
List1.Clear ' 清除列表框。
End Sub
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 picture."
MsgBox Msg ' 显示信息。
Picture = LoadPicture() ' 清除图片。
End Sub