I have an application with 20 textboxes, i need to do the calculations for example ((TextBox12 * TextBox1 * TextBox7) / 2) and display the result on label when clicking a button.
Ive usually done these like this:
private void lBtn_Click(object sender, EventArgs e) { double L, L2; if (double.TryParse(kTb1.Text, out L) && double.TryParse(kTb2.Text, out L2)) lBl4.Text = String.Format("{0:f1}", (L2 * L)); else MessageBox.Show("WTF } [/CODE]
I was wondering if there is better way to do this so that I don't have to add all 20 textboxes into this with && double.TryParse?
Indeed, it is. Doesn't mean we have to like it.
But at certain size you can make the "there is nowhere else to go to", ie see Apple/Google vs Epic Games lawsuit. Apple got struck down hard, even though you "can go elsewhere". Apple is 100% monopolistic on iOS though, Google is only 99% on Android, so I guess the comparison isn't exact.
But there's nothing illegal about it, that's the point. YouTube can be abusive with its policies, but they can always show you the door and you can always go to another platform. The problem is that everyone wants to be on YouTube. Think of YouTube as the Nvidia of video platforms.
Its sucks really hard, but it's the reality.
Question
Joni_78
Hi,
I have an application with 20 textboxes, i need to do the calculations for example ((TextBox12 * TextBox1 * TextBox7) / 2) and display the result on label when clicking a button.
Ive usually done these like this:
I was wondering if there is better way to do this so that I don't have to add all 20 textboxes into this with && double.TryParse?
Link to comment
https://www.neowin.net/forum/topic/1083591-c-calculating-textbox-values/Share on other sites
17 answers to this question
Recommended Posts