PC Review


Reply
Thread Tools Rate Thread

Can't change cursor within a control

 
 
=?Utf-8?B?Q3JhaWc=?=
Guest
Posts: n/a
 
      8th Feb 2005
I'm trying to do this within a control I've created:
Cursor.Current = Cursors.WaitCursor;

During the initialization of the parent form, my control gets added to the
form, and while the control is being intialized, I call a method within the
control that sets the cursor to Cursors.WaitCursor, then processing
continues. I want the Cursor to remain that way until I set it back at any
given time, and if I don't set it back, I want to remain a WaitCursor.
I can't get this to work, I'm guessing it might have to do with the loading
of the form, resetting the cursor or something? How can I do this?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q3JhaWc=?=
Guest
Posts: n/a
 
      8th Feb 2005
I've even now overriden the paint method in my custom control and the paint
method in the extended listView class that is within my custom control.
Within that paint method, I try and override every cursor I can find.

The result of this, is the cursor is a default cursor when over the extended
listView object within the control, but it is an hour glass when it is
anywhere else on the control or form.

protected override void OnPaint(PaintEventArgs pea) {

if (this.ThreadRunning) {
//I'm trying to adjust all of the cursors just for testing.
this.Parent.Cursor=Cursors.WaitCursor;
this.Cursor=Cursors.WaitCursor;
Cursor=Cursors.WaitCursor;
}
}

One other note, I am kicking off a worker thread within my extend listView
object that is on my custom control. Any thoughts?

"Craig" wrote:

> I'm trying to do this within a control I've created:
> Cursor.Current = Cursors.WaitCursor;
>
> During the initialization of the parent form, my control gets added to the
> form, and while the control is being intialized, I call a method within the
> control that sets the cursor to Cursors.WaitCursor, then processing
> continues. I want the Cursor to remain that way until I set it back at any
> given time, and if I don't set it back, I want to remain a WaitCursor.
> I can't get this to work, I'm guessing it might have to do with the loading
> of the form, resetting the cursor or something? How can I do this?

 
Reply With Quote
 
=?Utf-8?B?Q3JhaWc=?=
Guest
Posts: n/a
 
      8th Feb 2005
Appearantly this is a bug related to the cursor and listview, see quote from
a post by Peter Huang:

"Because this is a problem in the current winform control in .net FW
1.1(vs.net 2003), while in the next release Whidbey(.net FW 2.0), the
winform control will also be updated. So the problem is not the VS.NET IDE
but the underlying Framework which provides the listview
control.(system.windows.forms.dll)"

"Craig" wrote:

> I've even now overriden the paint method in my custom control and the paint
> method in the extended listView class that is within my custom control.
> Within that paint method, I try and override every cursor I can find.
>
> The result of this, is the cursor is a default cursor when over the extended
> listView object within the control, but it is an hour glass when it is
> anywhere else on the control or form.
>
> protected override void OnPaint(PaintEventArgs pea) {
>
> if (this.ThreadRunning) {
> //I'm trying to adjust all of the cursors just for testing.
> this.Parent.Cursor=Cursors.WaitCursor;
> this.Cursor=Cursors.WaitCursor;
> Cursor=Cursors.WaitCursor;
> }
> }
>
> One other note, I am kicking off a worker thread within my extend listView
> object that is on my custom control. Any thoughts?
>
> "Craig" wrote:
>
> > I'm trying to do this within a control I've created:
> > Cursor.Current = Cursors.WaitCursor;
> >
> > During the initialization of the parent form, my control gets added to the
> > form, and while the control is being intialized, I call a method within the
> > control that sets the cursor to Cursors.WaitCursor, then processing
> > continues. I want the Cursor to remain that way until I set it back at any
> > given time, and if I don't set it back, I want to remain a WaitCursor.
> > I can't get this to work, I'm guessing it might have to do with the loading
> > of the form, resetting the cursor or something? How can I do this?

 
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
Change ControlTipText when cursor over control ? =?Utf-8?B?bXNjZXJ0aWZpZWQ=?= Microsoft Access Forms 1 7th Jul 2005 10:30 PM
cant change cursor on Mouse Move event of List View Control Muhammad Aftab Alam Microsoft C# .NET 0 3rd Sep 2004 04:37 AM
Re: Cursor - How can I change the arrow cursor to a graphic(hand,heart Jens Peter Karlsen[FP-MVP] Microsoft Frontpage 0 29th Jul 2004 06:49 PM
Re: Cursor - How can I change the arrow cursor to a graphic(hand,heart chris leeds Microsoft Frontpage 0 29th Jul 2004 06:28 PM
Change Cursor over ActiveX control Stefan Microsoft Dot NET Framework Forms 0 22nd Jun 2004 06:58 PM


Features
 

Advertising
 

Newsgroups
 


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