Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleUse a custom mouse icon at run time
DescriptionThis example shows how to use a custom mouse icon at run time in Visual Basic 6. It sets the form's MousePointer property to 99 - Custom and then sets the MouseIcon property to the icon's image.
Keywordsmouse icon, mouse pointer, pointer, MousePointer
CategoriesGraphics
 
At design time, the form's MousePointer property was set to "99 - Custom."

When you click one of the form's Image controls at run time, the program highlights that control and sets the form's MouseIcon property to the Image control's picture.

 
Private m_SelectedIcon As Integer

Private Sub imgIcon_Click(Index As Integer)
    ' Highlight the selected icon.
    imgIcon(m_SelectedIcon).BorderStyle = vbBSNone
    m_SelectedIcon = Index
    imgIcon(m_SelectedIcon).BorderStyle = vbFixedSingle

    ' Set the mouse icon.
    MouseIcon = imgIcon(m_SelectedIcon).Picture
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated