Hi, David. My guess is that's just timing. I'd need a full example to know for sure. Instead of Queue, you could try setting a timer with a slightly larger delay. Queue is just a shortcut to StartTimer with a timeout of 0, so doing it yourself with a timeout of, say, 100 milliseconds might be a place to start.
Thanks, Aaron -- Aaron Smith Product Development & Integration Ai Squared 130 Taconic Business Park Rd Manchester Center, VT 05255 (802) 362-3612 x 208 [email protected] www.aisquared.com > -----Original Message----- > From: David [mailto:[email protected]] > Sent: Tuesday, October 4, 2016 11:08 AM > To: Aaron Smith <[email protected]>; Window-Eyes Scripting List > <[email protected]>; GWScripting <scripting@window- > eyes.com> > Subject: Re: Trouble in focusing an Editbox > > THanks, Aaron. > > Works in 90 percent of the cases. But still, every now and then, focus goes to > the Close-button. Not sure why. > > > Any further idea? > > > > David > > On 9/30/2016 6:08 PM, Aaron Smith wrote: > > I imagine the focus to your edit box is happening prior to the default focus > to the close button. Try queuing your control manipulation by doing > something like: > > > > If DEvent = DialogCreated Then > > Queue "DialogInit", dObj > > > > . . . > > > > Sub DialogInit(dObj) > > dObj.Control( "Box1" ).Text = FormatNumber( "2764.2345") > > dObj.Control( "Box2" ).Focus() > > End Sub > > > > Aaron > > > _______________________________________________ Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Ai Squared. For membership options, visit http://lists.window-eyes.com/options.cgi/scripting-window-eyes.com/archive%40mail-archive.com. For subscription options, visit http://lists.window-eyes.com/listinfo.cgi/scripting-window-eyes.com List archives can be found at http://lists.window-eyes.com/private.cgi/scripting-window-eyes.com
