View Single Post
  #3 (permalink)  
Old 12-01-2008, 7:44 PM
Spilled Spilled is offline
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Nov 2008
Location: USA
Age: 22
Posts: 14
Reputation: 18
Spilled is on a distinguished programming path ahead
Default

Quote:
Originally Posted by JohnH View Post
If you are crossthreading you must use control.invoke(delegate) to invoke the method on control thread, not delegate.invoke (this is same as calling method directly).
Ok I tried what you said and I get the error
"Invoke or BeginInvoke cannot be called on a control until the window handle has been created."
On this line: Return tbWordlist.Invoke(d)
Code:
    Public ReadOnly Property GetCombo() As String
        Get
            Dim d As New GetComboCallBack(AddressOf GetTheCombo)
            Return tbWordlist.Invoke(d)
        End Get
    End Property
    Public Function GetTheCombo() As String
        Dim tmp As String
        tmp = lbWordlist.Items.Item(tbWordlist.Value - 1)
        If tbWordlist.Value = tbWordlist.Maximum Then
            StopBots = True
        Else
            tbWordlist.Value += 1
        End If
        Return tmp
    End Function
Can you please explain what im doing wrong? and thank you very much for your help so far
Reply With Quote