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
Israel
690
1.3k
219.6k
Alerting message using textboxes than only codes
Oct 15 2016 8:19 AM
Hi!
I wrote these codes and work well. What I am doing first before to explain what I need.
As you can see when I put number minus to 5 it's should display a message. For that I do use three textboxes. Two textboxes to put number and the thirth one where the message should appear if the number its minus than 5.
But my big problem is. How can I can use decimal number using textboxes as this:
decimal d1, d2, total;
decimal.TryParse(txtBox1.Text, out d1);
decimal.TryParse(txtBox2.Text, out d2);
total = d1 - d2;
txtBox3.Text = total.ToString("N");
But the real code is:
private void txtBox3_TextChanged(object sender, EventArgs e)
{
string s = (sender as TextBox).Text;
int i = Convert.ToInt16(s);
if (i < 5)
{
MessageBox.Show("The stock is minimum. Thanx!");
(sender as TextBox).Focus();
}
}
Reply
Answers (
5
)
How to export mvc webpage into PDF?
add dynamically datagridviewcombobox in datagridview