ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   focusing mouse pointer to the specific button in a userform (https://www.excelbanter.com/excel-programming/402481-focusing-mouse-pointer-specific-button-userform.html)

tom taol

focusing mouse pointer to the specific button in a userform
 


userform1.show
After the following code ,and then I want to be focused with mouse
pointer to the specific button(for example, commandbutton1)
automatically.

Maybe, it would seem be used win32Api.

*** Sent via Developersdex http://www.developersdex.com ***

RB Smissaert

focusing mouse pointer to the specific button in a userform
 
Look at the GetCursorPos and SetCursorPos API's.

RBS


"tom taol" wrote in message
...


userform1.show
After the following code ,and then I want to be focused with mouse
pointer to the specific button(for example, commandbutton1)
automatically.

Maybe, it would seem be used win32Api.

*** Sent via Developersdex http://www.developersdex.com ***



tom taol

focusing mouse pointer to the specific button in a userform
 
thanks, but i want to how to know the handle of the commandbutton1 on a
userform1.



*** Sent via Developersdex http://www.developersdex.com ***

RB Smissaert

focusing mouse pointer to the specific button in a userform
 
I don't think command buttons on Userforms have window handles.
You will have to work out the position of the button and move the cursor
accordingly.

RBS


"tom taol" wrote in message
...
thanks, but i want to how to know the handle of the commandbutton1 on a
userform1.



*** Sent via Developersdex http://www.developersdex.com ***




All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com