ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Status of Focus (https://www.excelbanter.com/excel-programming/353364-status-focus.html)

Soniya[_4_]

Status of Focus
 
Hello!,

Is there a way to check the status of focus in a userform control?

some thing like :

if Textbox1.focus = true or if textbox1.setfocus = true ???

Thanks


Jim Rech

Status of Focus
 
I think you have to find if the ActiveControl is the one you're interested
in.

Private Sub UserForm_Click()
Debug.Print ActiveControl.Name
End Sub


--
Jim
"Soniya" wrote in message
oups.com...
| Hello!,
|
| Is there a way to check the status of focus in a userform control?
|
| some thing like :
|
| if Textbox1.focus = true or if textbox1.setfocus = true ???
|
| Thanks
|



Soniya[_4_]

Status of Focus
 
Thanks for your reply.

I got the point. Still my code does'nt work !!

What i am trying to do is:

I have two TextBoxes in my UserForm.

by cliking a SpinButton I want to increase and decrease the font size
based on which TextBox has the current focus.

If the user has clicked TextBox1 (the content is locked) SpinUp should
increase the font size by 1 and if the user has clicked on Textbox2
then spin up should increase the font size in TextBox 2

Thanks



All times are GMT +1. The time now is 11:18 AM.

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