VB.NET将任意图像文件设置为鼠标形状

来源:网络时间:2011-06-28 15:03:16

代码
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fd As OpenFileDialog = New OpenFileDialog()
fd.Filter = "图像文件(*.jpg;*.gif;*.png)|*.jpg;*.gif;*.png"
If fd.ShowDialog() = windows.Forms.DialogResult.OK Then
Dim fn As Image = Image.FromFile(fd.FileName)
Dim bitmap As New Bitmap(fn)
Dim handle As IntPtr = bitmap.GetHicon()
Dim myCursor As New Cursor(handle)
Me.Cursor = myCursor
End If
End Sub

文章内容来源于网络,不代表本站立场,若侵犯到您的权益,可联系我们删除。(本站为非盈利性质网站) 联系邮箱:9145908@qq.com
多特网友 2012-06-05 23:09:45 回复
好好 谢谢
多特网友 2012-06-05 23:09:45 回复
好好 谢谢