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
698
1.3k
217.6k
To link two pices of codes with condition
Jan 6 2020 9:24 AM
Hi,
I have four textboxs (txtResultA, txtResultB, txt_SoldForResultA, txt_SoldForResultB).
The two txtBoxes: txtResultA, txtResultB doing one operation. But when one of these txtBoxes have a number superior to another one. The result should be displayed on txt_SoldForResultA or txt_SoldForResultB.
For example, txtBoxA.Text (100) – txtBoxB.Text (70) = 30 (should appear on txt_SoldForResultA).
Another example is, txtBoxA.Text (70) – txtBoxB.Text (100) = 30. For this result should be appear on txt_SoldForResultB.
double d1, d2, total0;
double.TryParse(txtBoxA.Text, out d1);
double.TryParse(txtBoxB.Text, out d2);
total0 = d1 - d2;
txtBox_SoldForA.Text = total0.ToString("N2");
/////// Need to link these two pieces of code to do what I explained
double d3, d4, total1;
double.TryParse(txtBoxA.Text, out d3);
double.TryParse(txtBoxB.Text, out d4);
total1 = d3 - d4;
txtBox_SoldForB.Text = total1.ToString("N2");
Reply
Answers (
4
)
How to insert the records into DB(MYSQL)
how to bind multiple child textbox to one master textbox