473,396 Members | 2,002 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,396 software developers and data experts.

Changing Cursor in custom ControlDesigner

Joe
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 SizeAll, to SizeWE.

In the class for my derived ControlDesigner, i have the following code:

protected override void OnSetCursor()
{
try
{
if (this._InSplitter)
{
this.Control.Cursor = Cursors.SizeWE;
}
else
{
base.OnSetCursor();
}
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}

Everything else, in both my control and designer, function normally.
However, when I mouse over the designated area and the above code is
triggered, the IDE crashes. Actually, i wouldn't call it crashing, it just
disappears w/o warning. The whole IDE instance is gone. Any one have any
clues? The offending line is

this.Control.Cursor = Cursors.SizeWE;

I have tried using the same line of code elsewhere in my designer class, and
while it doesn't crash, it doesn't work either.

I've tried this on my laptop using C# 2005 Express, and my desktop using the
full VS pro 2005, with the same results.

Any help greatly appreciated,

Joe
Jul 14 '06 #1
1 2358
Joe
"Joe" wrote:
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 SizeAll, to SizeWE.

In the class for my derived ControlDesigner, i have the following code:

protected override void OnSetCursor()
{
try
{
if (this._InSplitter)
{
this.Control.Cursor = Cursors.SizeWE;
}
else
{
base.OnSetCursor();
}
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}

Everything else, in both my control and designer, function normally.
However, when I mouse over the designated area and the above code is
triggered, the IDE crashes. Actually, i wouldn't call it crashing, it just
disappears w/o warning. The whole IDE instance is gone. Any one have any
clues? The offending line is

this.Control.Cursor = Cursors.SizeWE;

I have tried using the same line of code elsewhere in my designer class, and
while it doesn't crash, it doesn't work either.

I've tried this on my laptop using C# 2005 Express, and my desktop using the
full VS pro 2005, with the same results.

Any help greatly appreciated,

Joe
I tried following the directions here
http://msdn2.microsoft.com/en-us/library/5ytx0z24.aspx
to debug my designer code at design time.

When stepping through the code,
this.Control.Cursor = Cursors.SizeWE;
works fine, but as soon as I hit F5 to run through it, it crashes the
debugger instance of VS. Any clues?

Joe
Jul 15 '06 #2

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

Similar topics

3
by: Geoff Soper | last post by:
I'm trying to dynamically change the cursor of a couple of maps over an image. Basically the image is in an online photo system where there is a rotate mode. In this mode clicking on the left or...
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: ...
10
by: Matt Fielder | last post by:
I have developed a custom control to be used in my application. My application includes a form designer, so the control can be hosted while designmode for the control is either true or false,...
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: CroDude | last post by:
Hi all! I've made a custom group-box control derived from a GroupBox. Additionally I've made a ControlDesigner derived class associated with my group box to remove some unneeded properties. But...
2
by: Jim Frazer | last post by:
Hi, I'm working on an application in C# that will allow the user to create simple CAD drawings on a CEPC system. I would like to be able to change the cursor shape depending on the drawing mode...
2
by: mohit | last post by:
Hello, I am making a custom control which places some restrictions on the value of Text property of the control. While debugging i noticed that when the control is drag-dropped on a form during...
0
by: Andy Wynn | last post by:
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...
3
by: Sagaert Johan | last post by:
Hi I have a custom control that displays an image. I have the invalidate method fired when a new picture is selected in the designer, but the designer does not show this change. It only does...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.