I have 2 classes. From my Class 1, I run 10 Threads in Class 2 with some methods in Class 2.
Now the threads are calling a method in my class 1, methods going to execute, checked this with a messagebox. But I have there also a code line for appending some text to a textbox, and this is not getting executed.
I already tried it with an invoke.
Here some snippets:
private void LaunchButton_Click(object sender, EventArgs e)
{
Scanner s = new Scanner(IPText.Text, Convert.ToInt32(Number1Text.Text), Convert.ToInt32(Number2Text.Text), Convert.ToInt32(TimeoutText.Text));
s.start(Convert.ToInt32(ThreadsText.Text));
}
at this snippet, I call the start method in class 2.
This method which got called by the threads from class 2:
public void AktuellerNummer(string Nummer)
{
LogText.Invoke(new Action(() =>
{
LogText.AppendText("Checking: " + Nummer);
LogText.ScrollToCaret();
}));
}
Here is how the threads call the method ,,AktuellerNummer":
Class1 class1 = new Class1();
class1.AktuellerZahl(Zahl.ToString());
Nothing got appended after the call, some guys of you know the reason?
Best regards.