Validation in Wizards
Thu 20 Dec 2018 - 10:53
Original post by Gareth Ahmun
Firstly apologies that this relates to Designer rather than Scripting (there is no Designer forum).
Is the only way to validate a number being input using the spinner control?
Can this validation be achieved with a standard text box?
Thanks, Gareth
Firstly apologies that this relates to Designer rather than Scripting (there is no Designer forum).
Is the only way to validate a number being input using the spinner control?
Can this validation be achieved with a standard text box?
Thanks, Gareth
Re: Validation in Wizards
Thu 20 Dec 2018 - 10:56
Original post by Daniel Thompson
Hello Gareth To do it with out the Spinner control does require scripting so you are in the correct area. You would be best to use the Changed Event then validate the value if incorrect show a message box and blank the result.
Hello Gareth To do it with out the Spinner control does require scripting so you are in the correct area. You would be best to use the Changed Event then validate the value if incorrect show a message box and blank the result.
- Code:
protected virtual void txtNumber_Changed(object sender, System.EventArgs e)
{
value = 0;
string tovalidate = Convert.ToString(EnquiryForm.GetIBasicEnquiryControl2("txtNumber", EnquiryControlMissing.Exception).Value);
if (int.TryParse(tovalidate, out value) == false && String.IsNullOrEmpty(tovalidate)== false)
{
FWBS.OMS.UI.Windows.MessageBox.ShowInformation(“Value is incorrect”);
EnquiryForm.GetIBasicEnquiryControl2(“txtNumber”,EnquiryControlMissing.Exception).Value = "";
EnquiryForm.GetControl("txtNumber").Focus();
}
}
Permissions in this forum:
You cannot reply to topics in this forum