473,387 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Custom Designer Cursor Behavior

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

Jan 10 '07 #1
0 1324

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Simon Wigzell | last post by:
I have an image with several links in it in mapped areas. I am using a custom cursor on the page and would like to have a custom cursor appear on mouse over of the mapped links. Something like: ...
9
by: James Geurts | last post by:
Hey all... I posted this in the vs.net ide group too, but people are not answering, so I figured that it might be more appropriate here. I'm not sure if I'm adding a designer to my code properly. ...
2
by: Brad | last post by:
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....
4
by: Robert | last post by:
I've created a custom control that inherits System.Windows.Forms.UserControl. It consists of three labels next to each other. I am able to access the control's properties and methods, but none...
1
by: Robert | last post by:
This is the code for the custom control: Public Class SPCLabel Inherits System.Windows.Forms.UserControl #Region " Windows Form Designer generated code " Public Sub New() MyBase.New()
5
by: ross kerr | last post by:
Hi All, I am extending the combobox to create a control that selects an item based on the text the user is typing into the text area of the control. I have an issue that occurs only when i...
1
by: Joe | last post by:
I'm working on a usercontrol, and an associated ControlDesigner for it. In the designer, when I mouse over a particular area of the usercontrol, I want to change the cursor from the standard...
4
by: ThunderMusic | last post by:
Hi, I have a custom form that works fine when I debug it or run it in release mode but cannot be loaded in the designer... Actually, it can be loaded in the designer when no control is on it, but...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.