im trying to make a simple example in threading this error msg
can anyone help me to solve it ?

Cross-thread operation not valid: Control 'cmb1' accessed from a thread other than the thread it was created on.

Imports System.Threading

Public Class Form1

    Inherits System.Windows.Forms.Form

    Dim th1 As Thread
    Dim th2 As Thread

    Private Sub Form1_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles MyBase.Load
        th1 = New Thread(AddressOf proc1)
        th2 = New Thread(AddressOf proc2)
    End Sub

    Sub proc1()
        Dim iCount As Integer
        For iCount = 1 To 10
    End Sub

    Sub proc2()
        Dim iCount As Integer
        For iCount = 11 To 20
    End Sub

End Class

Edited 2 Years Ago by Reverend Jim: fixed formatting

You have to use a delegate to modify controls. It's not complicated and there is a tutorial on how to use BackGround threads which includes a discussion of delegates. Once you have read the tutorial feel free to post any follow up questions here.

thank you very much :)

Private Delegate Sub proc1Delegate()
Private Delegate Sub proc2Delegate()


 If Me.InvokeRequired Then


make the program work correctly ^_^ 
This question has already been answered. Start a new discussion instead.