动态加载鼠标_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > 动态加载鼠标

动态加载鼠标

 2013/12/18 16:09:04  Blogs_min  博客园  我要评论(0)
  • 摘要:CursormyCursor=newCursor(Cursor.Current.Handle);System.Resources.ResourceManagerrs=newSystem.Resources.ResourceManager(typeof(form));rs.GetObject("pen");stringappPath=System.IO.Directory.GetCurrentDirectory()
  • 标签:鼠标

     Cursor myCursor = new Cursor(Cursor.Current.Handle);
            System.Resources.ResourceManager rs = new System.Resources.ResourceManager(typeof(form));
            rs.GetObject("pen");
            string appPath = System.IO.Directory.GetCurrentDirectory();
            IntPtr colorCursorHandle = LoadCursorFromFile(appPath + "鼠标图标");
            myCursor.GetType().InvokeMember("handle", BindingFlags.Public |
            BindingFlags.NonPublic | BindingFlags.Instance |
            BindingFlags.SetField, null, myCursor,
            new object[] { colorCursorHandle });
            this.Cursor = myCursor;

发表评论
用户名: 匿名