PC Review


Reply
Thread Tools Rate Thread

Custom Cursors on Custom Controls

 
 
=?Utf-8?B?QnJhZA==?=
Guest
Posts: n/a
 
      9th Feb 2005
Hi all, newbie here.
I'm currently designing a custom splitter control...
When the mouse hovers over a certain area on my splitter I need to be able
to display a custom cursor that I've designed.

I've tried several ways to assign my custom cursor to a cursor variable, the
most obvious being by the filename:
myCursor = new Cursor("c:\\myCursor.cur");
and then assign it as the current cursor when in position:
Cursor.current = myCursor
However when I do this the cursor displayed is Ibeam cursor and not my
cursor !!

I've also tried assigning the cursor by changing the Build Action property
on my cursor file to 'Embedded Resource' then loading as such:
myCursor = new Cursor(GetType(), "myCursor.cur");
This causes a an unhandled exception with info 'Value cannot be null". I
assume this is referring to the GetType() ????

I've also tried to do this using a resource manager:
ResourceManager resources = new ResourceManager(typeof(MySplitter));
myCursor = (Cursor)resources.GetObject("myCursor.cur");
But when I do this there is no cursor displayed at all when I change the
current cursor to 'myCursor'.

Any ideas where I'm going wrong chaps?

Thanks in advance

 
Reply With Quote
 
 
 
 
=?Utf-8?B?QnJhZA==?=
Guest
Posts: n/a
 
      11th Feb 2005
No-one have any ideas on this ?
Still haven't found a solution

"Brad" wrote:

> Hi all, newbie here.
> I'm currently designing a custom splitter control...
> When the mouse hovers over a certain area on my splitter I need to be able
> to display a custom cursor that I've designed.
>
> I've tried several ways to assign my custom cursor to a cursor variable, the
> most obvious being by the filename:
> myCursor = new Cursor("c:\\myCursor.cur");
> and then assign it as the current cursor when in position:
> Cursor.current = myCursor
> However when I do this the cursor displayed is Ibeam cursor and not my
> cursor !!
>
> I've also tried assigning the cursor by changing the Build Action property
> on my cursor file to 'Embedded Resource' then loading as such:
> myCursor = new Cursor(GetType(), "myCursor.cur");
> This causes a an unhandled exception with info 'Value cannot be null". I
> assume this is referring to the GetType() ????
>
> I've also tried to do this using a resource manager:
> ResourceManager resources = new ResourceManager(typeof(MySplitter));
> myCursor = (Cursor)resources.GetObject("myCursor.cur");
> But when I do this there is no cursor displayed at all when I change the
> current cursor to 'myCursor'.
>
> Any ideas where I'm going wrong chaps?
>
> Thanks in advance
>

 
Reply With Quote
 
Mick Doherty
Guest
Posts: n/a
 
      11th Feb 2005
\\\
Private myCursor as Cursor = New Cursor(Me.GetType, "myCursor.cur")
///
assign the cursor:
\\\
Cursor = myCursor
///
reset the cursor:
\\\
Cursor = Nothing
///

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


"Brad" <(E-Mail Removed)> wrote in message
news:88456359-3DA9-42D1-A699-(E-Mail Removed)...
> No-one have any ideas on this ?
> Still haven't found a solution
>
> "Brad" wrote:
>
>> Hi all, newbie here.
>> I'm currently designing a custom splitter control...
>> When the mouse hovers over a certain area on my splitter I need to be
>> able
>> to display a custom cursor that I've designed.
>>
>> I've tried several ways to assign my custom cursor to a cursor variable,
>> the
>> most obvious being by the filename:
>> myCursor = new Cursor("c:\\myCursor.cur");
>> and then assign it as the current cursor when in position:
>> Cursor.current = myCursor
>> However when I do this the cursor displayed is Ibeam cursor and not my
>> cursor !!
>>
>> I've also tried assigning the cursor by changing the Build Action
>> property
>> on my cursor file to 'Embedded Resource' then loading as such:
>> myCursor = new Cursor(GetType(), "myCursor.cur");
>> This causes a an unhandled exception with info 'Value cannot be null". I
>> assume this is referring to the GetType() ????
>>
>> I've also tried to do this using a resource manager:
>> ResourceManager resources = new ResourceManager(typeof(MySplitter));
>> myCursor = (Cursor)resources.GetObject("myCursor.cur");
>> But when I do this there is no cursor displayed at all when I change the
>> current cursor to 'myCursor'.
>>
>> Any ideas where I'm going wrong chaps?
>>
>> Thanks in advance
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom events in custom controls not appear in properties window Peted Microsoft C# .NET 0 25th May 2009 09:09 AM
Custom Controls: Import a custom namespace and use its functions within user Microsoft ASP .NET 1 19th Jul 2007 12:03 PM
My custom fields/controls keep moving on my custom contact form =?Utf-8?B?YWNleWNoYXNpbmc=?= Microsoft Outlook Form Programming 1 18th Jan 2005 03:28 PM
Custom Properties and Custom Controls - design time changes reflected visually. Wayne Microsoft VB .NET 0 31st Jul 2004 09:04 PM
zooming a custom control - layout custom controls in grid john menke Microsoft C# .NET 1 31st May 2004 06:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:57 AM.