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. use of a value in a form in another one

use of a value in a form in another one

Scheduled Pinned Locked Moved C#
helptutorial
6 Posts 3 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.
  • N Offline
    N Offline
    naghoumeh14
    wrote on last edited by
    #1

    i'm having a problem... i have a tab of buttons.. what i want is when i click one button i have to read the text written on and then open a new form with a background image having the same text as written on the button of the previous form... so here what i have to learn is how to know the text on the button clicked and then use this text in the next form to choose the corresponding image

    OriginalGriffO S 2 Replies Last reply
    0
    • N naghoumeh14

      i'm having a problem... i have a tab of buttons.. what i want is when i click one button i have to read the text written on and then open a new form with a background image having the same text as written on the button of the previous form... so here what i have to learn is how to know the text on the button clicked and then use this text in the next form to choose the corresponding image

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Predictably, you get at the button text by using the button.Text property. So, if your button is called "butPassMyTextToANewForm", yoiu would get the text by saying: String s = butPassMyTextToANewForm.Text; Pass that to you new form, and off you go!

      All those who believe in psycho kinesis, raise my hand.

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      1 Reply Last reply
      0
      • N naghoumeh14

        i'm having a problem... i have a tab of buttons.. what i want is when i click one button i have to read the text written on and then open a new form with a background image having the same text as written on the button of the previous form... so here what i have to learn is how to know the text on the button clicked and then use this text in the next form to choose the corresponding image

        S Offline
        S Offline
        sanforjackass
        wrote on last edited by
        #3

        have you tried the way i told you yesterday!!!!!!!!!!!

        N 1 Reply Last reply
        0
        • S sanforjackass

          have you tried the way i told you yesterday!!!!!!!!!!!

          N Offline
          N Offline
          naghoumeh14
          wrote on last edited by
          #4

          i have tried but it didn't work i don't know why... it gave me a null value in the second form

          S 1 Reply Last reply
          0
          • N naghoumeh14

            i have tried but it didn't work i don't know why... it gave me a null value in the second form

            S Offline
            S Offline
            sanforjackass
            wrote on last edited by
            #5

            it cant be if you want i could post my project example for you tell me if you want?

            N 1 Reply Last reply
            0
            • S sanforjackass

              it cant be if you want i could post my project example for you tell me if you want?

              N Offline
              N Offline
              naghoumeh14
              wrote on last edited by
              #6

              it worked finally .. i found the problem... i was declaring the public value in the parent form.... thank you very much

              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