'//
'//顯示自定義動畫鼠標或彩色圖標
'//根據【孟子e章】的專欄c#代碼 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 " windows 窗體設計器生成的代碼 "
public sub new()
mybase.new()
'該調用是 windows 窗體設計器所必需的。
initializecomponent()
'在 initializecomponent() 調用之后添加任何初始化
end sub
'窗體重寫 dispose 以清理組件列表。
protected overloads overrides sub dispose(byval disposing as boolean)
if disposing then
if not (components is nothing) then
components.dispose()
end if
end if
mybase.dispose(disposing)
end sub
'windows 窗體設計器所必需的
private components as system.componentmodel.icontainer
'注意: 以下過程是 windows 窗體設計器所必需的
'可以使用 windows 窗體設計器修改此過程。
'不要使用代碼編輯器修改它。
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為windows自帶的光標:
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
新聞熱點
疑難解答
圖片精選