Ste
Ste

Reputation: 2293

Set the cursor to WaitCursor with PowerShell and WPF GUI

If I use a regular windows form in PowerShell using this works.

$Form.Cursor = [System.Windows.Forms.Cursors]::WaitCursor

How can I achieve the same when dealing with a WPF application in PowerShell?

Upvotes: 1

Views: 2691

Answers (1)

Mathias R. Jessen
Mathias R. Jessen

Reputation: 174505

The property name on WPF elements is the same (Cursor).

Assign one of the static member values from the [System.Windows.Input.Cursors] class:

$wpfElement.Cursor = [System.Windows.Input.Cursors]::Wait

Upvotes: 2

Related Questions