PC Review


Reply
Thread Tools Rate Thread

Changing Cursor in custom ControlDesigner

 
 
=?Utf-8?B?Sm9l?=
Guest
Posts: n/a
 
      15th Jul 2006
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9l?=
Guest
Posts: n/a
 
      15th Jul 2006
"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
 
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
ControlDesigner for a custom form (not a child control) vmantrana Microsoft Dot NET Framework Forms 1 15th Feb 2008 07:57 AM
WPF question - ControlDesigner for WPF custom controls? =?Utf-8?B?RG9yb24=?= Microsoft C# .NET 1 10th Apr 2007 08:10 PM
ControlDesigner for custom control mohit Microsoft C# .NET 2 16th Oct 2006 02:42 PM
ControlDesigner for custom win control mohit Microsoft Dot NET Framework Forms 0 14th Oct 2006 11:27 AM
Siziing UserControls via a custom ControlDesigner dei Microsoft Dot NET Framework Forms 4 14th Jul 2005 05:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:21 PM.