将ico读取到Image控件中
再在PictureBox的MouseMove事件中编写代码移动Image就行了可以参考这个(这是托动窗体的):Private tx As Single
Private ty As SinglePrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
tx = X
ty = Y
End If
End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Me.Move Me.Left + X - tx, Me.Top + Y - ty
End If
End Sub
再在PictureBox的MouseMove事件中编写代码移动Image就行了可以参考这个(这是托动窗体的):Private tx As Single
Private ty As SinglePrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
tx = X
ty = Y
End If
End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Me.Move Me.Left + X - tx, Me.Top + Y - ty
End If
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货