473,738 Members | 5,934 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't change cursor within a control

I'm trying to do this within a control I've created:
Cursor.Current = Cursors.WaitCur sor;

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.WaitCur sor, 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 7886
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(PaintEv entArgs pea) {

if (this.ThreadRun ning) {
//I'm trying to adjust all of the cursors just for testing.
this.Parent.Cur sor=Cursors.Wai tCursor;
this.Cursor=Cur sors.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.WaitCur sor;

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.WaitCur sor, 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(PaintEv entArgs pea) {

if (this.ThreadRun ning) {
//I'm trying to adjust all of the cursors just for testing.
this.Parent.Cur sor=Cursors.Wai tCursor;
this.Cursor=Cur sors.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.WaitCur sor;

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.WaitCur sor, 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
2691
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 is the best way to keep the cursor from jumping to another non-visible control when the user tabs past the (currently designated) last control on the form. I've had some luck using the Leave event but the last visible control can change...
0
1714
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 nothing appears to be happening. IntPtr hCursor;
3
28301
by: Shawn Mesiatowsky | last post by:
how do you change the mouse cursor to an hour glass? thanks for your help
9
37206
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, Christian Blackburn
3
3036
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 MouseHover event. To get a Mousehover I must leave and reenter the control. I'd like to get an event each time the cursor stops moving.
2
3880
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 working very fine. When i copy this procedure in other database and try to run the procedure, the procedure runs successful, but the cursor does not populate the values, when i run the query written in the cursor, query returns the correct values....
1
32485
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 hand cursor when moving over the control like with a hyperlink, making it easy to spot for the user (I guess you saw this one coming). In Access 2007 I could simply make the control a hyperlink with the "always" attribute, and the hand cursor appears...
0
1892
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 seconds before the modal form is actually displayed. I would like to change the cursor to the WaitCursor between the time that the menu item is clicked and the modal form is actually visible. I've tried setting the form's cursor in the Load event...
3
2260
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 check its validity and apply appropriate actions. I have tried to do this using the control's 'On Change' event, and the properties '.Value' and '.Text' to return the control's old and new values. Unfortunately this event triggers on each...
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8788
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9476
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9263
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8210
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.