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
shah
NA
42
0
Reset textfield based on other textfields values
Aug 29 2012 7:37 AM
hello,
1. I want to populate totaltextfield value based on other textfields at runtime e.g. if i enter 1 in txtbox1 then totaltextfield should show 1 rather then if i have 5 textboxes entering value in each of them and then getting totaltextfield populated
2. I want to reset my totaltextfield value when i change values in some textfields
what i do basically if i enter some values in textfields e.g. 1, 2 etc and then later changing them then the totaltxtfield value do not get reset properly
Below is some piece of code i am using:
private void frdtxtBox_TextChanged(object sender, EventArgs e)
{
if (Convert.ToDecimal(frdtxtBox.Text) < 0 || Convert.ToDecimal(frdtxtBox.Text) > 1)
{
MessageBox.Show("Please enter the number between 0-1");
frdtxtBox.Clear();
return;//this stops the method processing any further as you wouldn't want to calculateTime if the number is invalid
}
calculateTime();
}
....
..
public void calculateTime()
{
decimal total = Decimal.Parse(monTxtBox.Text) + Decimal.Parse(tuesTxtBox.Text) + Decimal.Parse(wedTxtBox.Text) + Decimal.Parse(thurTxtBox.Text) + Decimal.Parse(frdtxtBox.Text);
totalTimetxtBox.Text = total.ToString();
}
thanks
Reply
Answers (
2
)
how to get the selected dropdown item as the filename in the savefiledialogue box
accessing xml in C#