Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread Namespace / PairCharValidator Class / PairChars Property
Example


In This Topic
    PairChars Property
    In This Topic
    Gets a PairChar list that is matched to the specified value.
    Syntax
    'Declaration
     
    Public ReadOnly Property PairChars As List(Of PairChar)
    'Usage
     
    Dim instance As PairCharValidator
    Dim value As List(Of PairChar)
     
    value = instance.PairChars
    public List<PairChar> PairChars {get;}

    Property Value

    A PairChar list that is matched to the specified value.
    Example
    This example uses pair character validation.
    //The error backcolor is displayed if the text contains a single, non-matching parenthesis
    FarPoint.Win.Spread.CellStyleNotify cnotify = new FarPoint.Win.Spread.CellStyleNotify();
    cnotify.InvalidCellStyle.BackColor = Color.Yellow;
    FarPoint.Win.Spread.PairChar pair = new FarPoint.Win.Spread.PairChar();
    pair.Left = '(';
    pair.Right = ')';
    FarPoint.Win.Spread.PairCharValidator pairvalid = new FarPoint.Win.Spread.PairCharValidator();
    pairvalid.PairChars.Add(pair);
    pairvalid.Actions.Add(cnotify);
    fpSpread1.Sheets[0].AddValidators(new FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), pairvalid);
    'The error backcolor is displayed if the text contains a single, non-matching parenthesis
    Dim cnotify As New FarPoint.Win.Spread.CellStyleNotify()
    cnotify.InvalidCellStyle.BackColor = Color.Yellow
    Dim pair As New FarPoint.Win.Spread.PairChar()
    pair.Left = "("
    pair.Right = ")"
    Dim pairvalid As New FarPoint.Win.Spread.PairCharValidator()
    pairvalid.PairChars.Add(pair)
    pairvalid.Actions.Add(cnotify)
    FpSpread1.Sheets(0).AddValidators(New FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), pairvalid)
    See Also