Private Const OCR_NORMAL As UInteger = 32512 <DllImport("user32.dll")> _ Private Shared Function LoadCursorFromFile _ (ByVal lpFileName As String) _ As IntPtr End Function <DllImport("user32.dll")> _ Private Shared Function SetSystemCursor _ (ByVal hCursor As IntPtr, _ ByVal id As Integer) _ As Boolean End Function <DllImport("user32.dll")> _ Public Shared Function LoadCursor(ByVal hInstance As IntPtr, _ ByVal id As UInteger) _ As IntPtr End Function Private Sub frm_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles MyBase.Load Dim cursor As IntPtr = LoadCursorFromFile("C:\cursor.cur") SetSystemCursor(cursor, OCR_NORMAL) End Sub Private Sub btn_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles btn.Click SetSystemCursor(LoadCursor(IntPtr.Zero, OCR_NORMAL), OCR_NORMAL) End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)