Show
'//
'//Show custom animated mouse or color icon
'//According to "Mencius E chapter" of the column C # code http://blog.csdn.net/net_lover/archive/2004/10/22/146575.aspx
'//
' Imports System.Runtime.InteropServices
Imports System.Reflection
Public Class Form1
Inherits System.Windows.Forms.Form
#Region "code generated by the Windows forms Designer"
Public Sub New ()
MyBase.New ()
' This call is required by the Windows Forms Designer.
InitializeComponent ()
' Add any initialization after the InitializeComponent () call
End Sub
' Form overrides dispose to clean up the list of components.
Protected Overloads Overrides Sub Dispose (ByVal disposing as Boolean)
If disposing Then
If not (components are nothing) Then
Components. Dispose ()
End If
End If
Mybase.dispose (disposing)
End Sub
' Required by the Windows Forms Designer
Private Components as System.ComponentModel.IContainer
' NOTE: The following procedure is required by the Windows Forms Designer
' You can use the Windows Forms Designer to modify this procedure.
' Do not modify it using the Code Editor.
Friend WithEvents Savedlg as System.Windows.Forms.SaveFileDialog
<system.diagnostics.debuggerstepthrough () > Private Sub InitializeComponent ()
Me.savedlg = New System.Windows.Forms.SaveFileDialog
'
' Form1
'
Me.autoscalebasesize = New System.Drawing.Size (6, 14)
Me.clientsize = New System.Drawing.Size (360, 213)
Me.Name = "Form1"
Me.Text = "Form1"
End Sub
#End Region
Declare Function loadcursorfromfile Lib "user32" Alias "Loadcursorfromfilea" _
(ByVal lpFileName as String) As IntPtr
Private Sub Form1_Load (ByVal sender as System.Object, ByVal e as System.EventArgs) Handles MyBase.Load
Dim MyCursor as New Cursor (Cursor.Current.Handle)
' Dinosau2.ani for Windows with its own cursor:
Dim Colorcursorhandle as IntPtr = Loadcursorfromfile (". \dinosau2.ani ")
Mycursor.gettype (). InvokeMember ("Handle", BindingFlags.Public Or _
BindingFlags.NonPublic or BindingFlags.Instance or Bindingflags.setfield, _
Nothing, MyCursor, New Object () {colorcursorhandle}) '
Me.cursor = MyCursor
End Sub
End Class