Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a custom combo box(Text box, button and List View).

While typing in the text box, cursor disappears. How can I disable "Hiding cursor while typing" in my application.

I goggled and found that it is the system behavior called SPI_SETMOUSEVANISH. It can be turned off but it will affect applications.

How can I turn-off this only in my custom control?
Posted

1 solution

There is a solution.

If we set
C#
ListView.Capture=true; 


we can keep the mouse pointer without hiding. While setting Capture property of ListView as true, It will capture the mouse events and mouse pointer wont be disappeared while typing in TextBox.

Another Problem.

I am using RichTextBox instead of TextBox. The above mentioned technique will not work with RichTextBox. That means mouse cursor will disappear while typing in RichTextBox even though ListView.Capture=true.

When using RichTExtBox and ListView.Capture=true, ListView captures mouse move and mouse click events but mouse pointer is disappearing. Any one know why it is happening like this?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900