How to avoid input negative number on DevExpress.TextEdit
This is an example to show how to keep numeric type but do not allow input negative number.
DevExpress.XtraEditors.TextEdit te = new TextEdit();
te.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
te.Properties.Mask.EditMask = "n2";
te.EditValueChanging += (s, e) =>
{
e.Cancel = e.NewValue.ToString().Contains("-");
};
Written by 小叮噹文青
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Devexpress
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#