problm wth tab control
-
hi.. i m using tab control(windows appln.wth C#) i want to check the entered 3 marks in 3 text boxesin first tab page,whethr any of the txt boxes contain below 100.how to use "or" for this? and in next tab page i want to print the result according to that in a label or txtbox. i m new to C# .pls giv idea. i trie this(below).but not wrking. int x = Convert.ToInt32(Txtapti.Text); int y = Convert.ToInt32(Txttech.Text); int z = Convert.ToInt32(Txteng.Text); if (x < 70 || y < 70 || z < 70) { Txtresult.Text = "candidate failed!"; }
-
hi.. i m using tab control(windows appln.wth C#) i want to check the entered 3 marks in 3 text boxesin first tab page,whethr any of the txt boxes contain below 100.how to use "or" for this? and in next tab page i want to print the result according to that in a label or txtbox. i m new to C# .pls giv idea. i trie this(below).but not wrking. int x = Convert.ToInt32(Txtapti.Text); int y = Convert.ToInt32(Txttech.Text); int z = Convert.ToInt32(Txteng.Text); if (x < 70 || y < 70 || z < 70) { Txtresult.Text = "candidate failed!"; }
Hello, First I have to say that your problem has nothing todo with your subject line. (you have no problem with the tabcontrol)
accessred wrote:
but not wrking.
What does it do? Have you debuged it?
accessred wrote:
i trie this(below).
Where have you placed that code?
accessred wrote:
Convert.ToInt32(Txtapti.Text);
This is not good, as it will throw an exception if you input a non int string in your textbox. I would do a int.TryParse if you have .Net > 1.1 or double.TryParse if you have .Net < 2.0. All the best, Martin
-
Hello, First I have to say that your problem has nothing todo with your subject line. (you have no problem with the tabcontrol)
accessred wrote:
but not wrking.
What does it do? Have you debuged it?
accessred wrote:
i trie this(below).
Where have you placed that code?
accessred wrote:
Convert.ToInt32(Txtapti.Text);
This is not good, as it will throw an exception if you input a non int string in your textbox. I would do a int.TryParse if you have .Net > 1.1 or double.TryParse if you have .Net < 2.0. All the best, Martin
-
Hello,
accessred wrote:
m using .Net 2.0.
Ok, but thats the only thing I have not asked! I don't think that your problem is solved, or am I wrong? Still waiting for more infos, to help you. All the best, Martin
see..problem may be small..but i m a begnner in coding..thats y.. i 'm having a tab control with three tabpages.in page1,three text boxes are there for each subject marks.all details will be stored in a file that is displayed in 2nd page.third is result page.if any of the entered value is less than 100 then the result page should show the candidate failed. that shud be displayed on a textbox.(txtresult.Text) it s the problem. :)
"I am burning...the only thing rest in me is you..."
-
see..problem may be small..but i m a begnner in coding..thats y.. i 'm having a tab control with three tabpages.in page1,three text boxes are there for each subject marks.all details will be stored in a file that is displayed in 2nd page.third is result page.if any of the entered value is less than 100 then the result page should show the candidate failed. that shud be displayed on a textbox.(txtresult.Text) it s the problem. :)
"I am burning...the only thing rest in me is you..."
Hello,
accessred wrote:
problem may be small..but i m a begnner in coding
´ Nothing you have to be ashamed for, everybody started once and had also "small" problems.
accessred wrote:
thats y
:confused: Don't understand that!
accessred wrote:
i 'm having a tab control with three tabpages.in page1,three text boxes are there for each subject marks.all details will be stored in a file that is displayed in 2nd page.third is result page.if any of the entered value is less than 100 then the result page should show the candidate failed. that shud be displayed on a textbox.(txtresult.Text) it s the problem.
I understood the question also at the first time. But I asked 3 questions and you answered 0 of them. So with no more information about your code, we will not be able to help you! All the best, Martin
-
Hello,
accessred wrote:
problem may be small..but i m a begnner in coding
´ Nothing you have to be ashamed for, everybody started once and had also "small" problems.
accessred wrote:
thats y
:confused: Don't understand that!
accessred wrote:
i 'm having a tab control with three tabpages.in page1,three text boxes are there for each subject marks.all details will be stored in a file that is displayed in 2nd page.third is result page.if any of the entered value is less than 100 then the result page should show the candidate failed. that shud be displayed on a textbox.(txtresult.Text) it s the problem.
I understood the question also at the first time. But I asked 3 questions and you answered 0 of them. So with no more information about your code, we will not be able to help you! All the best, Martin
answers: 1) i debugged the code.when running no error is coming,jus not displaying the result. 2)code placed in
private void Txtresult_TextChanged(object sender, EventArgs e)
3)double.TryParse is not working.error comins as: "no over load for method tryparse takes 1 arguments""I am burning...the only thing rest in me is you..."
-
answers: 1) i debugged the code.when running no error is coming,jus not displaying the result. 2)code placed in
private void Txtresult_TextChanged(object sender, EventArgs e)
3)double.TryParse is not working.error comins as: "no over load for method tryparse takes 1 arguments""I am burning...the only thing rest in me is you..."
Hello,
accessred wrote:
- i debugged the code.when running no error is coming,jus not displaying the result.
OK
accessred wrote:
2)code placed in private void Txtresult_TextChanged(object sender, EventArgs e)
So, I would assume that the code is not executed because you are not changing the code of the result textbox. You actually whant to write the result to the textbox. I would think, you should place a button on the page and on Click you execute the code.
accessred wrote:
3)double.TryParse is not working.error comins as: "no over load for method tryparse takes 1 arguments"
As you said you have .Net 2.0 you could also use the int.TryParse, but here is the way I would do it in .Net 1.1
using System.Globalization;
double d;
int i
if(double.TryParse(label.Text,NumberStyles.Integer, CultureInfo.CurrentCulture, out d))
{
i= Convert.ToInt32(d);
}Hope it helps! All the best, Martin