我想在 BackgroundWorker 进程在另一个线程中运行时显示沙漏光标并禁用窗口。
这就是我正在做的事情:
Private Sub MyButton_Click(...)
Dim box As New AnotherWpfWindow()
box.Owner = Me
...
box.ShowDialog()
If (box.DialogResult.GetValueOrDefault = True) Then
Me.IsEnabled = False
Me.Cursor = Cursors.Wait
MyBackgroundWorker.RunWorkerAsync()
End If
End Sub
Private Sub MyBackgroundWorker_RunWorkerCompleted(...)
UpdateInterface()
Me.IsEnabled = True
Me.Cursor = Cursors.Arrow
End Sub
窗口像我想要的那样被禁用,但光标仍然是一个箭头。我怎样才能使它成为等待光标?
根据这个问题 ,它似乎适用于vg1890 : Disabling all but one control in a WPF window