Displaying wait cursor in while backgroundworker is running

后端 未结 9 1922
傲寒
傲寒 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 03:58

    Here is what I'm doing now, I hope this help.

    private void LoadWaitCursor()
    {
        this.Dispatcher.Invoke((Action)(() =>
        {
            Mouse.OverrideCursor = Cursors.Wait;
        }));
    }
    private void LoadDefaultCursor()
    {
        this.Dispatcher.Invoke((Action)(() =>
        {
            Mouse.OverrideCursor = null;
        }));
    }
    

提交回复
热议问题