Xceed Workbooks for .NET v2.0 Documentation
SetError Method
Example 


Xceed.Workbooks.NET Assembly > Xceed.Workbooks.NET Namespace > DataValidation Class : SetError Method
The error message's title.
The error message's text.
The DataValidationErrorStyle.
When set to true, the error message will be displayed when the user enters invalid data. 
Sets an error message.
Syntax
'Declaration
 
Public Function SetError( _
   ByVal title As String, _
   ByVal text As String, _
   Optional ByVal style As DataValidationErrorStyle, _
   Optional ByVal show As Boolean _
) As DataValidation
'Usage
 
Dim instance As DataValidation
Dim title As String
Dim text As String
Dim style As DataValidationErrorStyle
Dim show As Boolean
Dim value As DataValidation
 
value = instance.SetError(title, text, style, show)

Parameters

title
The error message's title.
text
The error message's text.
style
The DataValidationErrorStyle.
show
When set to true, the error message will be displayed when the user enters invalid data. 
Remarks
This message will appear when the user tries to enter a value that is not valid.
Example
DataValidation validation = DataValidation.Create( ValidationType.TextLength ).SetRange( 5, 10 ).SetError( "This is my Custom Error", "Massive great error", DataValidationErrorStyle.Warning );
Requirements

Target Platforms: Windows 11, Windows 10, 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

Reference

DataValidation Class
DataValidation Members