Displaying wait cursor in while backgroundworker is running

后端 未结 9 1933
傲寒
傲寒 2020-12-30 03:50

During the start of my windows application, I have to make a call to a web service to retrieve some default data to load onto my application. During the load of the form, I

9条回答
  •  清歌不尽
    2020-12-30 04:15

    You should use the BGW's RunWorkerCompleted event to set your cursor back to the default.

    EDIT:

    Set your cursor to wait by calling this code before starting up your BGW:

    this.Cursor = Cursors.WaitCursor;
    

    Reset your cursor in the BGW's RunWorkerCompleted event by:

    this.Cursor = Cursors.Default;
    

提交回复
热议问题