BackgroundWorker - Cross-thread operation not valid

前端 未结 7 1115
南方客
南方客 2020-12-14 19:16

I have a winform application (one form), on this form there is a RichTextBox. In the constructor of this form I create an instance of the class MyClass. In the

7条回答
  •  误落风尘
    2020-12-14 19:49

    try this code,

    BeginInvoke((MethodInvoker)delegate
    {
        richtextBox.Text.Add("MyText");
    });
    

提交回复
热议问题