How to make dynamically created textbox to accpet only input?
I have dynamically created Textbox but not able to make it accept only numbers.How to do that?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sam HobbsRank #107 · 20.5K reputationPosted Oct 9, 2011, 6:34 PM EDT
{
base.OnKeyPress(e);
string keyInput = e.KeyChar.ToString();
if (Char.IsDigit(e.KeyChar))
{
return;
}
if (e.KeyChar == '\b')
{
return;
}
e.Handled = true;
}
VulpesRank #55 · 29.2K reputationPosted Oct 9, 2011, 1:55 AM EDT
jasbirsingh chauhan10 reputationPosted Oct 10, 2011, 4:46 AM EDT