Re: Help: Why don't SUBs execute instantly?



<cenozoite@xxxxxxxxxx> wrote in message news:1140822846.271653.199540@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Why doesn't it do that automatically? Telling it text1.text
= something should cause it to automatically change the
contents of that text box right away, before moving on
with the next line of code.

It *does* change the contents of the text box immediately, but it doesn't actually display those new contents on the screen until the text box gets a chance to refresh itself, which in your specific example code will be after the loop has terminated. You cane see this by doing:

Dim n As Long
Text1.Text = "Hello"
Me.Caption = Text1.Text
For n = 1 To 100000000
Next n
Me.Print "Done"

If you want the TextBox to refresh itself before your loop (or whatever) is entered then you need to explicitly tell it to do so, as in Text1.Refresh. Just jumping up and down and saying, "It's wrong, it shouldn't be like that" isn't actually gonna change things. It's like jumping on the bus to Liverpool and moaning all the time about the fact that it isn't going to Manchester. If you don't like it then get on a different bus ;-)

Mike


.



Relevant Pages

  • Re: Help: Why dont SUBs execute instantly?
    ... Not make a mental note to change textbox contents, ... loop, then come back and change contents after returning from loop. ... That's just backwards. ...
    (comp.lang.basic.visual.misc)
  • Re: Help: Why dont SUBs execute instantly?
    ... before moving on with the next line of code. ... loop, then come back and change contents after returning from loop. ... That's just backwards. ...
    (comp.lang.basic.visual.misc)