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.