Can't change cursor within a control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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?
 
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)"
 
Back
Top