TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
narasiman man
NA
0
118k
I post a question i have one field loan in that i have to type only numbers not characters
Jul 3 2012 4:13 AM
I post a question i have one field loan in that i have to type only numbers not characters.
Loan 1000.
you posted answers as follows
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(), "\\d+"))
e.Handled = true;
}
in that i click a loan text box
private void txt_loan_TextChanged(object sender, EventArgs e)
only text changed only there.not key press event.
what to do.
above one i am creating in vb.net using csharp. it is a window application.help me wat to do.
private void txt_others_TextChanged(object sender, EventArgs e)
{
int a, b, c, d;
if (!int.TryParse(txt_gross.Text, out a) || a < 0)
{
MessageBox.Show("Not a valid number. Please reenter.");
txt_gross.Focus();
return;
}
if (!int.TryParse(txt_totdeductions.Text, out b) || b < 0)
{
MessageBox.Show("Not a valid number. Please reenter.");
txt_totdeductions.Focus();
return;
}
if (!int.TryParse(txt_others.Text, out c) || c < 0)
{
MessageBox.Show("Not a valid number. Please reenter.");
txt_others.Focus();
return;
}
d = a - b + c;
txt_totpayable.Text = d.ToString();
}
in that onlytext changed only there.not key press event.how to do.please send the code.urgent.
Regards,
Narasiman P
Reply
Answers (
3
)
UserControl events - Not yet answered - Updated: Code added
Strange error when attempting to debug an ASP .NET MVC solution in IIS 7