不用api就可以了
image.picture=loadpicture(文件名)

解决方案 »

  1.   

    不是这么简单,我是将鼠标移动到image控件上,它自动更换图片,鼠标没有点击的动作
      

  2.   

    当然是可以的呀只要在 image 控件的 mousemove 事件里用verybelial(顶级狙击手) 的方法就可以呀
      

  3.   

    给你一个判断鼠标位置的代码参考,稍微改改就能满足你的要求=====================================
    '''新建工程,放一个 按钮 ,copy以下代码运行:Private Declare Sub ReleaseCapture Lib "user32" ()
    Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As LongPrivate Sub Command1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
        With PicShow
            If (x < 0) Or (y < 0) Or (x > Command1.Width) Or (y > Command1.Height) Then
                ReleaseCapture
                Command1.Caption = "鼠标离开"
            Else
                SetCapture Command1.hwnd
                Command1.Caption = "鼠标进入"
            End If
        End With
    End Sub
      

  4.   

    这个代码在Image控件上实现不了。因为Image控件没有hwnd属性