Monday, July 21, 2008

Visual Studio: Add Custom Cursor to the Resource File

To add a custom cursor:
1. Add the cursor resource to the project via the resource view.
2. Goto project's Properties -> Configuration Properties -> Linker -> Input
3. Add the filename of your cursor to Embed Managed Resource File
4. Use the following code to load the cursor:
this->Cursor = gcnew System::Windows::Forms::Cursor( Assembly::GetExecutingAssembly()->GetManifestResourceStream ("myCursor.cur") );


Ref:
How to set a custom cursor for CLR C++ WinForm Visual C++ General MSDN Forums

No comments: