ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is this right? SetFocus weirdness (https://www.excelbanter.com/excel-programming/323937-right-setfocus-weirdness.html)

David Curtis

Is this right? SetFocus weirdness
 
I have a userform which replaces an inputbox:

Function MyInputBox(caption, label)
UserForm1.TextBox1.SetFocus
UserForm1.TextBox1.Text = ""
UserForm1.caption = caption
UserForm1.Label1.caption = label
UserForm1.Show
MyInputBox = UserForm1.Value
End Function

On the build system (Excel2002/WinXP) the textbox receives the focus when
the form is shown, but on the user system (Excel2000/Win2K) when the form is
shown no control appears to have the focus. Is my code right?
Also, i found if on the user system I set the focus to button2 (last tab
orber) instead the form was shown correctly with the textbox having focus.

Any help would be appreciated.
Dave.




All times are GMT +1. The time now is 11:45 PM.

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