473,806 Members | 2,219 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cursor keeps resetting ?

I'm using this function to load a custom cursor from a .cur file;

public static extern IntPtr LoadCursorFromF ile(String str);

It works great but if I popup a ContextMenu or Control like a ListView, the
cursor resets to the system arrow. Even if I set the cursor property of each
control to the one loaded it just ignores it.

The ContextMenu doesn't support a cursor property either.

Is there maybe a win32api function to set the cursor of a Handle?

thanks

postie
Nov 16 '05 #1
1 2291
Ray
I had a similar cursor problem trying to get the wait cursor to show. What I
did for that was to set the cursor in my OnPaint() routine so that it was
the last thing done when the screen was updated for whatever reason.

In my case it was setting it to Cursor = Cursors.WaitCur sor; at the start of
the paint routine - and or any other lengthy routine and then setting it
back with Cursor=Cursors. Default; at the very end of OnPaint(). Your problem
is the opposite so I guess if you set the cursor to your new cursor at the
end of OnPaint then this will do the trick.

It will mean that you get the arrow cursor during a context menu etc but
this is probably what you want anyway.

Ray
"ilPostino" <ne**@ip80.co m> wrote in message
news:e1******** ******@tk2msftn gp13.phx.gbl...
I'm using this function to load a custom cursor from a .cur file;

public static extern IntPtr LoadCursorFromF ile(String str);

It works great but if I popup a ContextMenu or Control like a ListView, the cursor resets to the system arrow. Even if I set the cursor property of each control to the one loaded it just ignores it.

The ContextMenu doesn't support a cursor property either.

Is there maybe a win32api function to set the cursor of a Handle?

thanks

postie

Nov 16 '05 #2

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

Similar topics

1
1912
by: dinesh prasad | last post by:
I'm simply trying to divide each close1 column by 20, then insert that value into the twentydayMA field. The query keeps on running without finishing, even if I'm only using a single page of data. What could be making this hang? To execute, I'm using exec tad778. I thought about using another cursor to to handle the return values, instead of trying to directly do so using the single cursor. Any ideas? Thanks.. Dinesh
2
9500
by: ansonee | last post by:
I wrote a stored procedure that contains some COMMIT logic, but keep runnign into an odd problem. As soon as the procedure gets to the COMMIT statement, the CURSOR closes. Here's the procedure: CREATE PROCEDURE AIM.UPDATEARCHIVERETRIEVALSTATUS ( ) SPECIFIC AIM.UPDATEARCRETSTS LANGUAGE SQL P1: BEGIN DECLARE RECORDCOUNT INTEGER;
1
351
by: ilPostino | last post by:
I'm using this function to load a custom cursor from a .cur file; public static extern IntPtr LoadCursorFromFile(String str); It works great but if I popup a ContextMenu or Control like a ListView, the cursor resets to the system arrow. Even if I set the cursor property of each control to the one loaded it just ignores it. The ContextMenu doesn't support a cursor property either.
2
7890
by: Craig | last post by:
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...
2
4267
by: Juan Manuel Formoso | last post by:
Hi, I have a custom made toggle button, and I want to change the cursor in my application when it's pressed. I set the Cursor.Current property whenever that state changes, but on mouseup it reverts back to the default cursor automatically. I did a few tests, and putting a button in a blank form, setting the Cursor.Current property OnMouseEnter, only changes the cursor in the border of the button. If I keep moving it it reverts again to...
4
4967
by: Shane | last post by:
I have a text box select items in a listview as text is being typed into the text box. I get the select bar to move correctly in the Listview control. If the user presses the down or up key in the text box, I want to move to the selected item in the listview box. The down or up arrow does set focus to the listview box and the selected item switches from the grey of being unfocused to the blue of focus. So far, so good.
10
2114
by: Franky | last post by:
I think I misread a post and understood that if I do: System.Windows.Forms.Cursor.Current = Cursors.WaitCursor there is no need to reset the cursor to Default. So I made all the reset statements into comments (placed an ' in front)
4
6979
by: mike | last post by:
I have the opportunity to rescue a project that uses a mouse to sense the relative position of a machine. The hardware is built...just needs to be programmed. Stop snickering!!! I didn't do it...I just gotta fix it. I need to make some calculations on the measurements and VB6 is my language. Yes, the system mouse will corrupt the measurement, but it's an auditing function and that's acceptable.
1
2539
by: luigidavinci | last post by:
I am using Scriptaculous to achieve a pretty simple and straightforward effect. I need a couple of images and text to fade in and fade out periodically, which I already managed to do it using SetInterval, Effect.Appear and Effect.Fade. The only problem is that while the effects are taking place(fading in/out) the cursor keeps flickering in IE(not in firefox) changing rapidly from the normal cursor to the progress cursor and back. is there a way...
0
9718
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
9596
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,...
1
10370
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,...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5545
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...
1
4328
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3849
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
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.