Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. problm wth tab control

problm wth tab control

Scheduled Pinned Locked Moved C#
csharptutorialquestion
8 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    accessred
    wrote on last edited by
    #1

    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!"; }

    M 1 Reply Last reply
    0
    • A accessred

      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!"; }

      M Offline
      M Offline
      Martin 0
      wrote on last edited by
      #2

      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

      A 1 Reply Last reply
      0
      • M Martin 0

        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

        A Offline
        A Offline
        accessred
        wrote on last edited by
        #3

        m using .Net 2.0. Thnx..

        "I am burning...the only thing rest in me is you..."

        M 1 Reply Last reply
        0
        • A accessred

          m using .Net 2.0. Thnx..

          "I am burning...the only thing rest in me is you..."

          M Offline
          M Offline
          Martin 0
          wrote on last edited by
          #4

          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

          A 1 Reply Last reply
          0
          • M Martin 0

            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

            A Offline
            A Offline
            accessred
            wrote on last edited by
            #5

            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..."

            M 1 Reply Last reply
            0
            • A accessred

              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..."

              M Offline
              M Offline
              Martin 0
              wrote on last edited by
              #6

              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

              A 1 Reply Last reply
              0
              • M Martin 0

                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

                A Offline
                A Offline
                accessred
                wrote on last edited by
                #7

                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..."

                M 1 Reply Last reply
                0
                • A accessred

                  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..."

                  M Offline
                  M Offline
                  Martin 0
                  wrote on last edited by
                  #8

                  Hello,

                  accessred wrote:

                  1. 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

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups