Try searching the web lots of articles and samples are available,

http://msdn.microsoft.com/en-us/vbasic/ms789075.aspx

Above is the link of 101 Samples for Visual Basic 2005. Download the "Base
Class Library Samples - Group 2". In which you will find samples of "Working
with threads to manage multiple tasks simultaneously".

Good luck.


On Fri, Jun 19, 2009 at 2:33 PM, musa.biralo <[email protected]> wrote:

>
> Thanks Arsalan,
>
> Do you have any snippet that you can share or am I asking a lot...?
> Being a beginner it's hard to judge the requirement of the code. If
> you share some code that's great if not even great as i will learn
> more...
>
> Thanks for you time.
>
> On Jun 19, 2:25 am, Arsalan Tamiz <[email protected]> wrote:
> > It was working but your main UI thread is busy in your loops thats
> > why changes are NOT visible. In these type of scenarios we use
> > multi-threading, and can simply use backgroundworker.
> >
> > On Thu, Jun 18, 2009 at 5:51 PM, musa.biralo <[email protected]>
> wrote:
> >
> > > Hi there,
> >
> > > I am not sure why the very simple code is not working. I have asked
> > > very similar question before and it is somewhat based on that "How to
> > > update StatusStrip from class to  form". Any help will be a great
> > > help!!!
> >
> > > -----------------------
> > > Public Class Form1
> >
> > >    Public trash As New Class1
> >
> > >    Private WithEvents eventsUpdateSSclass1 As
> > > UpdateStatusStrip.Class1
> >
> > >    Private Sub UpdateStatusStrip(ByVal msg As String, ByVal color As
> > > Color) Handles eventsUpdateSSclass1.UpdateStatusStrip
> >
> > > Me.ToolStripStatusLabel1.Text = msg
> > >        Me.ToolStripStatusLabel1.BackColor = color
> > >        Me.StatusStrip1.Refresh()
> >
> > >    End Sub
> >
> > >    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
> > > As System.EventArgs) Handles Button1.Click
> > >        trash.runRunRun()
> > >    End Sub
> >
> > > End Class
> >
> > > ------------------------------------
> > > Public Class Class1
> >
> > >    Public Sub New()
> > >    End Sub
> >
> > >    Public Event UpdateStatusStrip(ByVal msg As String, ByVal color As
> > > Color)
> >
> > >    Public Sub runRunRun()
> > >        Dim k As Integer = 0
> > >        For i As Integer = 1 To 100
> > >            For j As Integer = 1 To 1000
> > >                k = j + i
> > >                RaiseEvent UpdateStatusStrip(CStr(k), Color.Orange)
> > >                'call UpdateStatusStrip(CStr(k), Color.Orange) is not
> > > working.
> >
> > >            Next
> > >        Next
> > >        RaiseEvent UpdateStatusStrip(String.Empty, Nothing) 'to check
> > >    End Sub
> >
> > > End Class
> > > --------------------------------------------
> >
> >

Reply via email to