Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems with setting cursor

Status
Not open for further replies.

hayt

IS-IT--Management
Oct 5, 2004
132
US
I have an application where i want to set a custom cursor for the life of the application instance. However, there have been several snags. first, and most importantly, i cannot seem to get this line of code to work:

cursor.current = cursors.default

nor can i get variations to work (ones that i have tried)

me.cursor.current = cursors.default
cursor = cursors.default
cursor.current = cursors.arrow
me.cursors.current = cursors.arrow

Nothing seems to work. after trying this for quite a while, i implemented a module that uses the user32 api to set the cursor to an animated cursor (ani) and then a cursor (cur) and that seems to work fine except that i do not know how to set the cursor back to the default. (since vb.net does not support ani files, i had to use the module, and found that it also works for cur files).

PLEASE PLEASE PLEASE....can anyone help me.
 
whats wrong with me.cursor = cursors.wait or something to that effect. why that current thingie?

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
I have no idea.....that's just what msdn said to write (as well as a few other websites and books). I tried me.cursor = cursors.arrow and nothing happened.
 
How about

Cursor.Current.Equals(Cursors.Default)

__________________________________________
Try forum1391 for lively discussions
 
...assuming there is a conditional statement somewhere there.

__________________________________________
Try forum1391 for lively discussions
 
ok.....i have discovered where the problem lies....i just do not understand it.

since vb.net does not support ani files, i had to create a module that would load an animated cursor using the user32 api. this seems to be causing the me.cursor = cursors.whatever to not work. if i get rid of the api calls, the me.cursor line works fine, with one exception.

when use the line:
Me.Cursor = New Cursor(AppDomain.CurrentDomain.BaseDirectory & "mycursor.cur")
i get the cursor to load, but with 2 colors (b/w).

and then, of course, i cannot use ani files.

does anyone have any idea how to use ani files, and how to get the me.cursor line to accept all colors?
 
ok...i seem to have an answer to my issue. it seems the cursor class in .net not only does not support ani files, but it does not support color cursors.

this article:
should have some info. i am going to try to implement it, and i will post my results for anyone interested in the outcome, or for anyone having similar problems.


thanks to everyone that helped....if anyone has any advice...i'm pretty sure that i could use it.
 
WORKED GREAT!!!!!! If anyone needs to implement a colored cursor, or animated cursor, then use this code!!!


hayt
 
If you would just give us a change.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
sorry that should have been chance

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top