[Tutor] Re: how do I sleep?

alan.gauld@bt.com alan.gauld@bt.com
Fri, 30 Nov 2001 15:00:17 -0000


> Private Sub txtValue_GotFocus(Index As Integer)
> DoEvents                    'external events
> txtValue(Index).SelStart = 0
> ...
> End Sub
> 
> This is my VB handler for text boxes when they get focus.
> The purpose is to select the current text value so that you 
> can copy/cut OR simply start typing and replace the whole string.

> DoEvents doesn't yield to other NT processes.  It yields to 
> other threads in the VB runtime.  VB has trouble doing all 
> of its screen handling in the right order.  

Ah I see. Yes you could use DoEvents for that. Its freeing 
the local process to read events from its own queue not 
doing anything with the NT kernel at all.

In that case it is a bit of VB cruft rather than an NT problem.

> I am very glad to say that I have never encountered this kind 
> of weird behavior in Python.

I've never encountered it even in other MS development tools
J++, VC++ etc. Certainly not in Delphi (my personal favourite 
NT tool)


Thanks for clarifying that,

Alan g