How to set mousepointer? 
Author Message
 How to set mousepointer?

Silly question, but how does one set the mousepointer? Tried the converter
for some hints, got this:

         'UPGRADE_ISSUE: Cannot set a custom mousepointer.
         'System.Drawing.Cursor.Current = 0

Could anyone be a bit more usefull than that? (shouldn't be hard :)

Best Regards,

Miguel Santos



Fri, 30 May 2003 08:27:02 GMT  
 How to set mousepointer?
Miguel,

Create a new System.Drawing.Cursor object, then assign it to the control's
Cursor property.  Something like...

    Dim oCustomCursor As Cursor
    oCustomCursor = New Cursor("YourCursorFile.cur")

    yourControl.Cursor = oCustomCursor

You can also create a new Cursor object from a resource or picture.

The enumeration for the standard cursors (including custom) is gone.
Instead there is just the one Cursor property, with the standard cursor
objects available from the System.Drawing.Cursors class.  So to return to
the default cursor, you would write...

    yourControl.Cursor = Cursors.Default

--
David.


Quote:
> Silly question, but how does one set the mousepointer? Tried the converter
> for some hints, got this:

>          'UPGRADE_ISSUE: Cannot set a custom mousepointer.
>          'System.Drawing.Cursor.Current = 0

> Could anyone be a bit more usefull than that? (shouldn't be hard :)

> Best Regards,

> Miguel Santos



Fri, 30 May 2003 02:18:49 GMT  
 How to set mousepointer?
Thanks for the answer, but what if I'm not assigning it to any control?

As in (pseudo-code)

Class Whatever
   Sub DoLotsOfStuff
      Screen.Mousepointer = 13 '(can't remember the constant)
      .....
      dolotsofstuff
      .....
      Screen.Mousepointer = 0
   End Sub
End Class

What would be the .net equivalent for that, when the controls or forms on
screen are not known, or the
project has no forms at all?

Best Regards,

Miguel Santos

David Bayley escreveu na mensagem ...

Quote:
>Miguel,

>Create a new System.Drawing.Cursor object, then assign it to the control's
>Cursor property.  Something like...

>    Dim oCustomCursor As Cursor
>    oCustomCursor = New Cursor("YourCursorFile.cur")

>    yourControl.Cursor = oCustomCursor

>You can also create a new Cursor object from a resource or picture.

>The enumeration for the standard cursors (including custom) is gone.
>Instead there is just the one Cursor property, with the standard cursor
>objects available from the System.Drawing.Cursors class.  So to return to
>the default cursor, you would write...

>    yourControl.Cursor = Cursors.Default

>--
>David.



>> Silly question, but how does one set the mousepointer? Tried the
converter
>> for some hints, got this:

>>          'UPGRADE_ISSUE: Cannot set a custom mousepointer.
>>          'System.Drawing.Cursor.Current = 0

>> Could anyone be a bit more usefull than that? (shouldn't be hard :)

>> Best Regards,

>> Miguel Santos



Fri, 30 May 2003 07:22:12 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting coordinates to set mousepointer

2. Set Mousepointer to Hourglass

3. How do I set the mousepointer to an hourglass

4. Setting MousePointer based on screen position

5. Help w win95/VB3 mousepointer will not set to hourglass

6. Help! Mousepointer disappears

7. Mousepointer

8. Can I change the shape of the mousepointer

9. mousepointer/balloon with text?

10. Mousepointer

11. PLEASE HELP: howto change mousepointer

12. Change Mousepointer doesn't work

 

 
Powered by phpBB® Forum Software