本文整理匯總了C#中System.Windows.Forms.Cursor.GetType方法的典型用法代碼示例。如果您正苦於以下問題:C# Cursor.GetType方法的具體用法?C# Cursor.GetType怎麽用?C# Cursor.GetType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.Cursor
的用法示例。
在下文中一共展示了Cursor.GetType方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Initialize
public static void Initialize(IntPtr handle)
{
cursorfns[(int)CursorType.Attack] = "cursors/attack.cur";
cursorfns[(int)CursorType.Normal] = "cursors/normal.cur";
cursorfns[(int)CursorType.Magic] = "cursors/magic.cur";
cursorfns[(int)CursorType.Talk] = "cursors/talk.cur";
cursorfns[(int)CursorType.NA] = "cursors/na.cur";
chandle = handle;
for (int i = 0; i < (int)CursorType.Lastword; ++i)
{
Cursor myCursor = new Cursor(chandle);
IntPtr colorCursorHandle = LoadCursorFromFile(cursorfns[i]);
myCursor.GetType().InvokeMember("handle", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetField, null, myCursor,
new object[] { colorCursorHandle });
cursors[i] = myCursor;
}
}
示例2: DdzMian
private Myweituo1 weituo5; //顯示遊戲結果窗體的委托
#endregion Fields
#region Constructors
public DdzMian()
{
InitializeComponent();
this.cbb_input.Select();
CheckForIllegalCrossThreadCalls = false;//為false可以跨線程調用windows控件
kaiju = new KaiJu();
this.skinEngine1.SkinFile = "Longhorn.ssk";
Cursor myCursor = new Cursor(Cursor.Current.Handle);
//dinosau2.ani為windows自帶的光標:
string path = System.IO.Directory.GetCurrentDirectory() +"冰.ani";
IntPtr colorCursorHandle = LoadCursorFromFile(path);//鼠標圖路徑
myCursor.GetType().InvokeMember("handle", BindingFlags.Public |
BindingFlags.NonPublic | BindingFlags.Instance |
BindingFlags.SetField, null, myCursor,
new object[] { colorCursorHandle });//5^1^a^s^p^x
//this.Cursor = myCursor;
}