C#: RunWorkerAsync() doesn't trigger DoWork()

前端 未结 4 1316
春和景丽
春和景丽 2021-01-21 03:28

I am writing a small forms based application to connect to an LDAP server, and I wanted the \"connect\" button to work in the background. So I was following the information and

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-21 04:31

    If u still have event and is not working, try the following

    Just call

    System.Windows.Forms.Application.DoEvents();

    before calling RunWorkerAsync()

提交回复
热议问题