Spread Windows Forms 6.0 Product Documentation
UserEntry Property
See Also  Example Support Options
FarPoint.Win Assembly > FarPoint.Win Namespace > SuperEditBase Class : UserEntry Property


Glossary Item Box

Gets or sets how data is validated when it is provided to the control.

Syntax

Visual Basic (Declaration) 
Public Overridable Property UserEntry As UserEntry
Visual Basic (Usage)Copy Code
Dim instance As SuperEditBase
Dim value As UserEntry
 
instance.UserEntry = value
 
value = instance.UserEntry
C# 
public virtual UserEntry UserEntry {get; set;}

Property Value

UserEntry setting that determines how user entry is handled

Remarks

This property either blocks invalid characters from being provided to the control or lets the user or code provide any value. What makes a character valid depends on the control and its property settings.

When this property is set to UserEntry.Formatted, the control validates every character when it is provided to the control, whether from a user typing or pasting or from code or a database. The control blocks any character that does not fit its criteria for valid characters, and a UserError event occurs.

When this property is set to UserEntry.FreeFormat, the control accepts any provided data.

All edit controls can validate supplied data when they lose the focus. If a control contains an invalid character or a value otherwise considered invalid when it loses the focus, an InvalidData event occurs. The control does not format the invalid value. If the value is valid, the control formats it, adding the defined symbols, such as a currency symbol, as specified by the related property settings.

This property is available from the SuperEditBase class.

Example

C#Copy Code
privatevoidForm1_Load(objectsender,System.EventArgse)
{
control.InvalidOption=FarPoint.Win.InvalidOption.HideData;
control.InvalidColor=Color.Blue;
control.UserEntry=FarPoint.Win.UserEntry.FreeFormat;
control.CausesValidation=true;
control.Text="InvalidColor";
}

privatevoidbutton1_Click(objectsender,System.EventArgse)
{
control.ResetInvalidColor();
}
Visual BasicCopy Code
PrivateSubForm1_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load
control.InvalidOption=FarPoint.Win.InvalidOption.HideData
control.InvalidColor=Color.Blue
control.UserEntry=FarPoint.Win.UserEntry.FreeFormat
control.CausesValidation=True
control.Text="InvalidColor"
EndSub

PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Click
control.ResetInvalidColor()
EndSub

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.