Alternatively you can call TextBox.Refresh() after you make the change to the TextBox.
Main Topics
Browse All Topicswith my code below, i will get output after all loop finished.
i want change it to make write in text after 1 loop finished ( not waiting to complete all loop finished )
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Of course t = New Thread(AddressOf ca.StartLoop) should be t = New Thread(AddressOf la.StartLoop).
And also Loop is a keyword, I guess that's why you ended up using Loops instead. I've managed to give it a test and just realised it's a keyword.
Oh and Private Class LoopArgs() should just be Private Class LoopArgs, with no brackets.
Of course I should have tried all this before posting..... ahem...
I'm copying bits from another list of code, and I missed the delegate bit.
Try adding the Delegate line below and changing StartCountDelegate to StartLoopDelegate, I changed it to that as it's more relevant to your app. So the top of this code should look like....
Delegate Sub StartLoopDelegate(ByVal iterations As Integer)
Private Class LoopArgs()
Public Reader As System.IO.StreamReader
Public FILE_NAME As String
Public StartDelegate As StartLoopDelegate
Public Sub StartLoop()
StartDelegate(Reader, FILE_NAME)
End Sub
End Class
I take it you have already added Imports System.Threading at the top of the code?
i has added added Imports System.Threadining
in this line :
StartDelegate(Reader, FILE_NAME)
i get this message:
Value of type 'System.IO.StreamReader' cannot be converted to 'Integer'. <<< in Reader
Too many arguments to 'WindowsApplication2.Form1
And in this line :
la.StartDelegate = AddressOf Loops
get this message
Method 'Public Sub Loops(ByRef Reader As System.IO.StreamReader, ByRef FILE_NAME As String)' does not have a signature compatible with delegate 'Delegate Sub StartLoopDelegate(iteratio
And here are complete source
For newer versions of .Net (2005 and above) consider using the BackgroundWorker control instead.
Without threading, it can also be accomplished by adding a call to Application.DoEvents() INSIDE the while loop.
Something like:
While Reader.EndOfStream = False
Str = Reader.ReadLine
Label1.Text = "Checking : " & Str
Try
cari = RequestWebData(Str)
If cari.Contains("http://www.
TextBox2.AppendText(Str & vbCrLf)
objWriter.Write(Str & vbCrLf)
End If
Catch ex As Exception
Label1.Text = "error"
End Try
Application.DoEvents() ' <--------------------------
End While
Business Accounts
Answer for Membership
by: PsyberionPosted on 2009-11-08 at 15:24:51ID: 25772520
You can have the loop output after 1 loop and output after each loop, by moving the loop to it's own thread.
Assuming of course you want the message box to appear after the whole loop, see the code below...
Regards,
Psyberion.
Select allOpen in new window