Handling Numeric fields, Allowing only 0-9 values + Back button only.
//Sample Text box.
private void textBoxLongStalk_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = (Utility.KeyPress(sender, e) == false) ? true : false;
}
//Common function to handle numeric only restriction
public static Boolean KeyPress(object sender, KeyPressEventArgs e)
{
if ((e.KeyChar >= (char)Keys.D0 && e.KeyChar <= (char)Keys.D9) || (e.KeyChar == (char)Keys.Back))
{
return true;
}
else
{
return false;
}
}
Subscribe to:
Post Comments (Atom)
Postgress - Read a XML file from a postgress table XML column
SELECT xmltable.* FROM xmldata, XMLTABLE('//ROWS/ROW' PASSING data COLUMNS id int PATH ...
-
if more than 65535 files in your temp folder, this error can occurs, To resolve this, remove all temporary files in C:/Windows/Temp ....
-
select upper(substr(CTY_CITY,1,1))|| substr(CTY_CITY,2,length(CTY_CITY)-1) as Ax from AGM_M_COUNTRY_CITY; update AGM_M_COUNTRY_CITY set ...
-
Common text box validation function for all the text boxes within the same form. Using Sender parameter to handle. private void tex...
No comments:
Post a Comment