Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

textbox messaging 1

Status
Not open for further replies.

psybertek

Technical User
Mar 26, 2002
30
US
I recently started learning VB. Way back in 82 I studied basic programming. I am having a hard time figuring out how to show the results of a for next loop in a text box. (eg)

(old basic)

for a = 1 to 1000
print a
next a

I figured out the code to show it in VB, the problem is that you can not (or rather I cannot) see the count incrementing on the screen, the code runs and then it shows 1000, I tried putting in nested loops to slow it down still no luck. I tried setting the value to 1,000,000 thinking maybe my machine was to fast, and I just wasn't seeing it. I have searched the "MSDN" library, no help. I know there is a way, I just can't find it. Any help would be greatly appreciated.

an old school basic programmer
 
for a = 1 to 1000
Text1.Text = a
DoEvents
next a

rgds
Andy
 
DoEvents is best avoided where it is not absolutely necessary. In this case you can replace andylec's DoEvents with Text1.Refresh
 
Thank you to all that answered Andylec & strongm,
I used the text1.refreszh and it worked very well.
Again thank you both for your answer to my call for help.
Psybertek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top