PC Review


Reply
Thread Tools Rate Thread

Custom Designer Cursor Behavior

 
 
Andy Wynn
Guest
Posts: n/a
 
      10th Jan 2007
Hello All,

I've got a custom control ( Panel-like, but not inheriting from Panel)
that
has a header region that's custom drawn.
Custom Control is using a custom controldesigner class that inherits
from
ParentControlDesigner.

Just for starters I wanted to try to change the mouse cursor if it fell

within the area of my header rectangle. So far I've not been able to
achieve this. The overall goal is to keep controls from being dropped
onto
my custom control's header area. I've not done any work with the drag
and
drop logic as of yet. Just wanted to try to make the mouse cursor
change to
see if I was on the right track.

I've done some testing by overriding WndProc and listening for
WM_MouseMove,
but to no avail.

Ex.
protected override void WndProc(ref Message m)
{
CollapsiblePanel cp = (CollapsiblePanel)this.Control;
switch (m.Msg)
{
case WM_MOUSEMOVE:
POINTAPI pnta = new POINTAPI();
GetCursorPos(ref pnta);
Point pt = this.Control.PointToClient(new Point(pnta.x, pnta.y));
if ((pt.X >= cp.Header.X && pt.X <= cp.Header.Width) && (pt.Y >=
cp.Header.Y
&& pt.Y <= cp.Header.Height))
{
this.Control.Parent.Text = "Bingo"
this.Control.Cursor = Cursors.No;
}
else
{
this.Control.Cursor = Cursors.Default;
}
break;
}
base.WndProc(ref m);
}

In testing I do get "Bingo" in the parent form text, but the cursor
doesnt
change.

What am I doing wrong here?

Thanks,

Andy

 
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
Can I create a custom control with a designer like a form designer trant Microsoft C# .NET 5 22nd Dec 2009 11:03 PM
Custom control container behavior in designer =?Utf-8?B?V2lsbGlhbSBTdWxsaXZhbg==?= Microsoft Dot NET Framework 2 8th Jul 2005 01:48 PM
Custom control container behavior in designer =?Utf-8?B?V2lsbGlhbSBTdWxsaXZhbg==?= Microsoft Dot NET Framework Forms 3 7th Jul 2005 05:46 PM
Unexpected page designer behavior Chuck Bowling Microsoft ASP .NET 1 4th Jul 2005 03:06 PM
Re: Strange behavior INF file and Component Designer (0/1) Brad Combs Windows XP Embedded 3 29th Aug 2003 12:00 PM


Features
 

Advertising
 

Newsgroups
 


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