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. how to pass textbox value from one form to other form in window application +c#

how to pass textbox value from one form to other form in window application +c#

Scheduled Pinned Locked Moved C#
csharphelptutorial
6 Posts 5 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.
  • M Offline
    M Offline
    mrcsn
    wrote on last edited by
    #1

    Hi how to pass textbox value from one form to other form in window application +c# .If any one knows this help me with code i'm new to window application Thanks and regards suman

    Steve EcholsS A C R 4 Replies Last reply
    0
    • M mrcsn

      Hi how to pass textbox value from one form to other form in window application +c# .If any one knows this help me with code i'm new to window application Thanks and regards suman

      Steve EcholsS Offline
      Steve EcholsS Offline
      Steve Echols
      wrote on last edited by
      #2

      Lots of different ways, but you could expose a property on one of the forms like: public string TheValue { get { return theTextBox.Text; } set { theTextBox.Text = value; } } Your other form can set TheValue using code like chee: form2.TheValue = "stuff"; form2 would be an instance of your "other form" which has already been created, of course.


      - S 50 cups of coffee and you know it's on!

      • S
        50 cups of coffee and you know it's on!
        Code, follow, or get out of the way.
      1 Reply Last reply
      0
      • M mrcsn

        Hi how to pass textbox value from one form to other form in window application +c# .If any one knows this help me with code i'm new to window application Thanks and regards suman

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

        You can also pass it to a session variable and u can retrive the values in the form u needed.

        C 1 Reply Last reply
        0
        • A ashok_rc5

          You can also pass it to a session variable and u can retrive the values in the form u needed.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          You're very confused. Forms apps do not have session variables.

          Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          1 Reply Last reply
          0
          • M mrcsn

            Hi how to pass textbox value from one form to other form in window application +c# .If any one knows this help me with code i'm new to window application Thanks and regards suman

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            http://www.codeproject.com/KB/dotnet/passingvaluesbetweenforms.aspx[^] Searching the site is often a good idea.

            Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            1 Reply Last reply
            0
            • M mrcsn

              Hi how to pass textbox value from one form to other form in window application +c# .If any one knows this help me with code i'm new to window application Thanks and regards suman

              R Offline
              R Offline
              Ravenet
              wrote on last edited by
              #6

              Hi very very easy there is 2 ways pass the value one form to a nother forms. 1.Properties 2.Constructor params In my point of 2ndis good because of when make cons we , just create overload cons and pass the varible to that. variable is textbox value

              Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com

              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