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. form design / update clash

form design / update clash

Scheduled Pinned Locked Moved C#
debuggingdesignhelpquestionannouncement
5 Posts 4 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.
  • E Offline
    E Offline
    Emmet_Brown
    wrote on last edited by
    #1

    Hello, In my form, I set a label's initial text as 0. in the Load() of this form, I make some calculations and then set the label's text to the output of these calculations. When I debug, I trace the calculations and nothing seems to be wrong. I tried to change the initial value of the label and I saw the new initial value in the runtime.

    for (int i = 0; i < dbGridView.Rows.Count; i++)
    {
    if (dbGridView.Rows[i].Cells[4].Value.ToString() == "Nakit")
    {
    top = top + Convert.ToDouble(dbGridView.Rows[i].Cells[7].Value.ToString());
    }
    }
    label5.Visible = true;
    label5.Text = top.ToString().Substring(0, 10);

    I'd like to sum the value in 7th cells and then convert the sum to string, and set the label with this. In debug, I see that 'top' is calculated properly but I cannot see the calculated value in the label in runtime. Anyone can help me? this is urgent :(

    R 1 Reply Last reply
    0
    • E Emmet_Brown

      Hello, In my form, I set a label's initial text as 0. in the Load() of this form, I make some calculations and then set the label's text to the output of these calculations. When I debug, I trace the calculations and nothing seems to be wrong. I tried to change the initial value of the label and I saw the new initial value in the runtime.

      for (int i = 0; i < dbGridView.Rows.Count; i++)
      {
      if (dbGridView.Rows[i].Cells[4].Value.ToString() == "Nakit")
      {
      top = top + Convert.ToDouble(dbGridView.Rows[i].Cells[7].Value.ToString());
      }
      }
      label5.Visible = true;
      label5.Text = top.ToString().Substring(0, 10);

      I'd like to sum the value in 7th cells and then convert the sum to string, and set the label with this. In debug, I see that 'top' is calculated properly but I cannot see the calculated value in the label in runtime. Anyone can help me? this is urgent :(

      R Offline
      R Offline
      Rajesh Anuhya
      wrote on last edited by
      #2

      add the below line at end of your code

      label5.Refresh();

      Cheers

      Rajesh B --> A Poor Workman Blames His Tools <--

      E 1 Reply Last reply
      0
      • R Rajesh Anuhya

        add the below line at end of your code

        label5.Refresh();

        Cheers

        Rajesh B --> A Poor Workman Blames His Tools <--

        E Offline
        E Offline
        Emmet_Brown
        wrote on last edited by
        #3

        thanks =) but the solution is to use Convert.toString(anydouble) instead of anydouble.toString() :)

        A 1 Reply Last reply
        0
        • E Emmet_Brown

          thanks =) but the solution is to use Convert.toString(anydouble) instead of anydouble.toString() :)

          A Offline
          A Offline
          AspDotNetDev
          wrote on last edited by
          #4

          Why did you delete your question? Now all we have an answer to an unknown question.

          [Forum Guidelines]

          C 1 Reply Last reply
          0
          • A AspDotNetDev

            Why did you delete your question? Now all we have an answer to an unknown question.

            [Forum Guidelines]

            C Offline
            C Offline
            Calla
            wrote on last edited by
            #5

            Kind of like sitting with "42", not knowing what the question is. Quite frustrating acutally.. :)

            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