Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to hide mouse when selecting by key in drop down com
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00961998
Message ID:
00962735
Views:
8
>Hi Dawa,
>
>Try if this code will work for you:
>CLEAR
>CLEAR ALL
>
>oForm = CREATEOBJECT("TForm")
>oForm.Show(1)
>
>DEFINE CLASS TForm As Form
>
>	ADD OBJECT txt As TextBox WITH Left=5,;
>	Top=10, Height=24, Width=100
>
>	ADD OBJECT cmb As ComboBox WITH Left=5,;
>	Top=30, Height=24, Width=100, Style=2
>
>PROCEDURE Init
>	DECLARE INTEGER ShowCursor IN user32 INTEGER bShow
>
>PROCEDURE Destroy
>	ThisForm._show
>
>PROCEDURE cmb.Init
>	THIS.AddItem("Anne")
>	THIS.AddItem("Bob")
>	THIS.AddItem("Chris")
>	THIS.AddItem("Dan")
>	THIS.AddItem("Evan")
>	THIS.AddItem("Frank")
>	THIS.AddItem("George")
>
>PROCEDURE txt.GotFocus
>	ThisForm._show
>
>PROCEDURE cmb.GotFocus
>	ThisForm._hide
>
>PROCEDURE _hide
>	DO WHILE ShowCursor(0) >= -1
>		DOEVENTS
>	ENDDO
>
>PROCEDURE _show
>	DO WHILE ShowCursor(1) < 0
>		DOEVENTS
>	ENDDO
>ENDDEFINE
>
>
>ShowCursor API is used to hide and show mouse pointer. When the pointer is hidden the mouse is still active. The code is kind of "fast and dirty", still it may help :)

Thank you for the reply,

I tried your code but the problem still exists even though the mouse cursor is hidden if you happen to have the mouse cursor in the list. In addition, this brings in another problem which is when you move the mouse to do things on other form and menus within the app the mouse is still hidden.

It would be great if there is/were a way to hide as well as disable the mouse when a combox drops down, then enable and display it when combox list clapses.
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform