Number only text box
-
Hi, How do you make a text box on a windows form accept numbers only? These is really easy in VC++ 6.0, can't be hard in C# Cheers Ollie Riches:confused:
-
Hi, How do you make a text box on a windows form accept numbers only? These is really easy in VC++ 6.0, can't be hard in C# Cheers Ollie Riches:confused:
I know two way for it. One: http://www.codeproject.com/cs/miscctrl/maskedcsedit.asp Two: Handle
KeyPress
event of text box yourself:private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if(e.KeyChar < 48 || e.KeyChar > 57 )
e.Handled = true;
}Mazy "The path you tread is narrow and the drop is shear and very high, The ravens all are watching from a vantage point near by, Apprehension creeping like a choo-train uo your spine, Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
-
Hi, How do you make a text box on a windows form accept numbers only? These is really easy in VC++ 6.0, can't be hard in C# Cheers Ollie Riches:confused: