次のサンプルコードは、
CellValidatorをカスタマイズして独自の
CellValidateActionを追加する方法を示します。このサンプルコードは、
CellValidatorクラスに示されている詳細なコード例の一部を抜粋したものです。
class MyIconNotifyAction : IconNotify
{
protected override void DoAction(ValidateActionContext context)
{
base.DoAction(context);
//When the error icon pop up, one system sound will play at the same time.
if (!context.IsValid)
{
System.Media.SystemSounds.Asterisk.Play();
}
}
}
Private Class MyIconNotifyAction
Inherits IconNotify
Protected Overloads Overrides Sub DoAction(ByVal context As ValidateActionContext)
MyBase.DoAction(context)
'When the error icon pop up, one system sound will play at the same time.
If Not context.IsValid Then
System.Media.SystemSounds.Asterisk.Play()
End If
End Sub
End Class