Make your own free website on
Working With Resource File

Lesson 1
Tutorials - Page 1 - Page 2 - Page 3 - Page 4 - Page 5 - Page 6 - Page 7 - Page 8 - Page 9 - Page 10

Accessing BMP, ICO and CUR files from your Program - Examples (Continue)
The next example will show you how to change your mouse cursor to other cursor that found in resource file.

Add a Cursor to your Resource File (under the Cursor "Folder") and rename its ID to "myCursor".

Set the form MousePointer property to 99 - Custom.
Add the following code to your form:

Private Sub Form_Load()
     Form1.MouseIcon = LoadResPicture("myCursor", vbResCursor)
End Sub

Run the program, and you will see that the mouse cursor is the cursor that found in your Resource File, under the "myCursor" ID.

That's the end of Lesson 1.
For more advanced techniques using Resource File (Like loading GIF, JPG and Sound files from Resource file) go to Lesson 2.

Back  Forward