|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
Changing A Mouse Cursor using C# Code. I am developing a new project using C#. I am trying to assign a curcer to a form...and i just cant do it due to me being quite a beginer but if someone could help that would be great. So far i have search this code but it is not working, Code: Private Sub Game_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Cursor = ("C:\Documents and Settings\Oliver C\Desktop\Programing\Projects\VRange\0,CD.cur") End Sub |
#2
| |||
| |||
Re: Changing A Mouse Curcer using C# Code. Code: Private Sub Game_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Cursor = ("C:\Documents and Settings\Oliver C\Desktop\Programing\Projects\VRange\0,CD.cur") End Sub So we must change that to C# code, Code: private void Game_Load(object sender, EventArgs e) { Cursor myCursor = new Cursor(@"C:\Documents and Settings\Oliver C\Desktop\Programing\Projects\VRange\0,CD.cur"); someControl.cursor = myCursor; //Replace someControl ! } |
#3
| |||
| |||
Re: Changing A Mouse Curcer using C# Code. When including a path in C# you have to escape the \ character as \\ or you could place an @ in front of the path. for example: Cursor = ("C:\\Documents and Settings\\Oliver C\\Desktop\\Programing\\Projects\\VRange\\0,CD.cur"); OR Cursor = (@"C:\Documents and Settings\Oliver C\Desktop\Programing\Projects\VRange\0,CD.cur"); |
![]() |
|
Tags: csharp, cursor, mouse |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Apple Magic Mouse: after Lion update, Mouse Cursor Jumping to Corners. | Acardi !! | Hardware Peripherals | 10 | 01-10-2011 04:08 PM |
Need information about the cursor changing in Pro Evolution Soccer 2012 | Christabel | Video Games | 4 | 22-09-2011 07:31 PM |
Changing the Cursor shape in Java | rashmi_ay | Software Development | 4 | 30-11-2009 10:58 AM |
Move Cursor without using a Mouse | Itronix | Tips & Tweaks | 2 | 14-03-2009 01:38 PM |
Mouse Cursor freezes? Help? | akbar | Windows XP Support | 3 | 01-03-2007 08:43 PM |