473,387 Members | 1,673 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.

Can't change cursor within a control

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?
Nov 16 '05 #1
2 7833
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?

Nov 16 '05 #2
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?

Nov 16 '05 #3

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

Similar topics

4
by: BBFrost | last post by:
We have a data entry application written within Framework 1.0 that contains 20+ custom user controls. The controls overlay each other so that only one custom control is visible at a time. What...
0
by: Muhammad Aftab Alam | last post by:
Hi All, I am facing a problem during changing the cursor on the mouse move event of a List View control. the event is captured but when I try to change the cursor as with the following code...
3
by: Shawn Mesiatowsky | last post by:
how do you change the mouse cursor to an hour glass? thanks for your help
9
by: Christian Blackburn | last post by:
Hi Gang, In VB6 is was relatively easy to change the pointer, but now I don't even see that as a property for any objects. Can somebody tell me how to do that in .NET? Thanks in Advance,...
3
by: Just Me | last post by:
If I move the mouse cursor over a control and stop moving I get a MouseHover event. If I then move the cursor while staying within the control and then stop moving I do not get another...
2
by: BilalGhazi | last post by:
Hi All, I have this strange problem. I am user of two different database (both are same version 9i). I created a procedure and within this procedure i used a cursor to select the values, this is...
1
Ericks
by: Ericks | last post by:
This must be a piece of cake and I'm sure it has been addressed somewhere in this forum. I have a form with a control that when clicked on opens another form. So I want the cursor to change to a...
0
by: =?Utf-8?B?a20=?= | last post by:
I've got a simple C# app built in VS2005. When I click a menu item a modal form opens and performs a lengthy operation in the Load event handler to populate a text control, so it takes a few...
3
by: SimonG via AccessMonster.com | last post by:
Hi, I would like to be able to compare a control's new value with its old value, whenever it is changed by a user. The control holds a numeric value, qty_Sold, when this value changes I need to...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.