mhouston100
mhouston100

Reputation: 1203

Powershell error provider BlinkStyle

I might be going crazy but I can't seem to figure out how to set the blinkrate on an ErrorProvider in Powershell.

Error provider is defined with:

$Global:ErrorProvider = New-Object System.Windows.Forms.ErrorProvider

I've tried various different versions of:

$ErrorProvider.BlinkStyle() = [System.Windows.Forms.ErrorBlinkStyle.NeverBlink]

or

$ErrorProvider.SetBlinkStyle([System.Windows.Forms.ErrorBlinkStyle.NeverBlink])

With no success!

This is my first PS with some Windows forms elements so I'm still feeling my way through.

Upvotes: 2

Views: 436

Answers (1)

Keith Hill
Keith Hill

Reputation: 201952

You specify an enum value like this in PowerShell:

[System.Windows.Forms.ErrorBlinkStyle]::NeverBlink

It is essentially like accessing a static member of a type. Try this:

$ErrorProvider.BlinkStyle = [System.Windows.Forms.ErrorBlinkStyle]::NeverBlink

Upvotes: 3

Related Questions