picture1.image=loadpicture("")在Mouse_clickup事件中添加if button=1 then
   picture1.print s
if button=2 then 
   picture1.print s1

解决方案 »

  1.   


    Cls 方法
          清除运行时 Form 或 PictureBox 所生成的图形和文本。语法object.Clsobject 所在处代表一个对象表达式,其值为“应用于”列表中的一个对象。如果省略 object,则带有焦点的 Form 就被认为是 object。说明Cls 将清除图形和打印语句在运行时所产生的文本和图形,而设计时在 Form 中使用 Picture 属性设置的背景位图和放置的控件不受 Cls 影响。如果激活 Cls 之前 AutoRedraw 属性设置为 False, 调用时该属性设置为 True,则放置在 Form 或 PictureBox 中的图形和文本也不受影响。 这就是说,通过对正在处理的对象的 AutoRedraw 属性进行操作,可以保持 Form 或 PictureBox 中的图形和文本。调用 Cls 之后,object 的 CurrentX 和 CurrentY 属性复位为 0。
    Cls 方法示例
    本示例使用 Cls 方法从一个窗体中删除打印信息。要检验此示例,可将本例代码粘贴到一个窗体的声明部分,然后按 F5 并单击该窗体。Private Sub Form_Click ()
       Dim Msg   ' 声明变量。
       AutoRedraw = -1   ' 打开 AutoRedraw。
       ForeColor = QBColor(15)   ' 将前景设置为白色。
       BackColor = QBColor(1)    ' 将背景设置为蓝色。
       FillStyle = 7   ' 设置对角线菱形。
       Line (0, 0)-(ScaleWidth, ScaleHeight), , B  ' 将框放在窗体上。
       Msg = "This is information printed on the form background."
       CurrentX = ScaleWidth / 2 - TextWidth(Msg) / 2  ' 设置 X 的位置。
       CurrentY = 2 * TextHeight(Msg)   ' 设置 Y 的位置。
       Print Msg   ' 打印信息至窗体。
       Msg = "Choose OK to clear the information and background "
       Msg = Msg & "pattern just displayed on the form."
       MsgBox Msg   ' 显示信息。
       Cls   ' 清除窗体的背景。
    End Sub