次のサンプルコードは、汎用検証コンポーネントの検証アクションに3段階の境界線による通知を設定する例です。
Imports GrapeCity.Win.Editors
' アクション(境界線通知)を作成します。
Dim ThreeStateBorderNotify1 As New ThreeStateBorderNotify()
' 入力された値が不正なときに表示する境界線を設定します。
ThreeStateBorderNotify1.InvalidLineColor = Color.Red
ThreeStateBorderNotify1.InvalidLineStyle = LineDashStyle.Dashed
ThreeStateBorderNotify1.InvalidLineWidth = 2
' 正しい値が入力されたときに表示する境界線を設定します。
ThreeStateBorderNotify1.ValidLineColor = Color.Green
ThreeStateBorderNotify1.ValidLineStyle = LineDashStyle.Solid
ThreeStateBorderNotify1.ValidLineWidth = 2
' TextBox1に作成した検証アクションを設定します。
GcCommonValidator1.GetValidateActions(TextBox1).AddRange(New ValidateAction() {ThreeStateBorderNotify1})
using GrapeCity.Win.Editors;
// アクション(境界線通知)を作成します。
ThreeStateBorderNotify threeStateBorderNotify1 = new ThreeStateBorderNotify();
// 入力された値が不正なときに表示する境界線を設定します。
threeStateBorderNotify1.InvalidLineColor = Color.Red;
threeStateBorderNotify1.InvalidLineStyle = LineDashStyle.Dashed;
threeStateBorderNotify1.InvalidLineWidth = 2;
// 正しい値が入力されたときに表示する境界線を設定します。
threeStateBorderNotify1.ValidLineColor = Color.Green;
threeStateBorderNotify1.ValidLineStyle = LineDashStyle.Solid;
threeStateBorderNotify1.ValidLineWidth = 2;
// textBox1に作成した検証アクションを設定します。
gcCommonValidator1.GetValidateActions(textBox1).AddRange(new ValidateAction[] {threeStateBorderNotify1});