本文整理汇总了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;
}