Quote:
Originally Posted by JohnH
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