vb.net - How to display a Labels 'Error on ErrorProvider1' -
target
I want to display the label I labeled as "ErrorTranslator 1 error" Attribute in the feature whenever I get an error see the properties of the label below.
I have my error provider1 how can I get an error on ErrorTrader 1 LblErr to display it in ErrorProvider1 Your problem is that you are replacing the error message when nothing is wrong as mentioned in your comment below, In the Trying to display the text in the red rectangle in the SetError (Control, Value) function. If the TextBox1.Text.Trim.Contains ("'") then the error reporter 1.SetError (lblErr, ErrorProvider1.GetError (lblErr)), other error reporter 1.SetError (lblErr, "") end If
SetError value
tag The local error message is accumulating, so that you can do the following:
If TextBox1.Text.Trim is included in it ("'' ') then ErrorTransfer 1.SetError (lblErr, lblErr.Tag) ) Other ErrorTrader 1.SetError (lblErr, "") If you were right to use
errorProvider1 GetError (Control) It is fine that you want to replace it with empty string before retrieving it.
Comments
Post a Comment