动态加载鼠标

     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;

posted on 2013-12-18 15:33  Blogs_min  阅读(336)  评论(0)    收藏  举报

导航