SetFocus error |
Post Reply |
Author | |
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
Posted: 11 June 2009 at 11:02am |
I have some vb textboxes on a Frame which is on a Tab control. All this is on a Form in an MDI child using DockingPane.
To move user from one text box to another, I use textbox(x).SetFocus This 95% works OK, but sometimes gives error. I think this error is same as if textbox is not enabled or not visible. I guess this is a timing error or similar. Most times the SetFocus is fine. But sometimes I guess the DockingPane is busy doing something and the SetFocus gives error. (without the DockingPane it always works OK.) Any ideas to workaround this? |
|
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
|
|
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
|
Possible workaround
The following sort of thing seems to work OK Sub AttemptSetFocus(myControl) On Error Goto ERR_SF For X = 1 to 5 myControl.SetFocus Exit Sub ERR_SF: DoEvents Next End Sub (Note this is not real code. Just to give the idea). |
|
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |