[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
vbmousepointer

How do I change the mouse pointer

Changing the mouse pointer within the VB language is a straight forward affair. Providing you use some thought regarding consistency and error handling, it can make your programming look more professional from a users point of view.

Method

Object.Mousepointer = Variant

Example:

Screen.Mousepointer = 11


Here’s a list of the available Mouse Pointer properties.

Property Property 
Index    Description
0	 Default
1	 Arrow
2	 Cross Hairs
3	 I Beam
4	 Icon
5	 Size
6	 Size NESW
7	 Size NS
8	 Size NW
9	 Size EW
10	 Up Arrow 
11	 Hourglass 
12	 No Drop 
13	 Arrow and hourglass 
14	 Arrow and question mark 
15	 Size all. 
99	 Custom icon  (See Mouse Icon Property)


Custom Icons:

You may wish you use a mouse pointer that’s exclusive to you application. To do this set the .MousePointer property to 99 ( Custom Icon ).

Method:

Object.MouseIcon = LoadPicture("PathandFileName”)

Example:

Form1.MouseIcon = LoadPicture(“C:\WINNT\Example.Cur”)


An instance of when you would want to change the mouse pointer could be when performing a time consuming event such as a database query. As mentioned earlier, changing the mouse pointer is a process that you can get a lot of out with minimal coding. However should an un-trapped error arise you should have measures in place to change the mouse pointer back to its default.

VB FAQ

last edited (March 19, 2004) by leeos, Number of views: 5456, Current Rev: 7 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.