开发者

What is the function call to update a form during an event

开发者 https://www.devze.com 2023-04-04 05:39 出处:网络
I am updating one of my old vb6 programs. I have not touched vb6 for a number of years. I cannot recall if there was a property on the form or a method call which would update form controls during an

I am updating one of my old vb6 programs. I have not touched vb6 for a number of years.

I cannot recall if there was a property on the form or a method call which would update form controls during an event.

The best way to articulate this was something like this.

In pseudo and while trying to avoid typing c# :)

button_click()
dim x as int = 0
while (x < 10000000)
   txtNumber.Text = x.ToString
   x = x + 1
end while

Curre开发者_StackOverflowntly, the txtNumber value does not update until the loop above has finished. Is there a form property or a method i must call to actual see the number increment?

thanks.


You want a DoEvents statement which will yield to the forms message queue. (Can't find the VB6 link so the posted one is for VBA but its information is correct) or you can call txtNumber.refresh

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号