How do i change mouse icon at runtime?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Luisa Rodrigues

    How do i change mouse icon at runtime?

    I'm programming in vb 2008 and i would like to change the mouse icon when the user crosses a certain object. I want the icon to be a picture of my own, not a system one. In vb6 it was really very simple and now i'm stuck with something aparantly so basic. I apreciate any help!
    Thanks!
    :)
  • marcellus7
    New Member
    • Oct 2008
    • 33

    #2
    Code:
    Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As _
    System.EventArgs) Handles MyBase.Load
    Me.Cursor = New Cursor("C:\Windows\Cursors\pen_m.cur")
    End Sub
    End Class

    Comment

    • Luisa Rodrigues

      #3
      Thanks for you answer, but it doesn't work with image cursor that i download from the net. They are valid cur files, because i'm able to change the mouse icon using directly the control panel, but when i try to change the mouse icon inside a vb event (like button_click), it says that the image is not valid and there is an error at the stream parameter. Do i have to declare or install somethig in order to make vb accept different cursor icons?

      Comment

      Working...