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. accessing data from one form in another form [modified]

accessing data from one form in another form [modified]

Scheduled Pinned Locked Moved C#
question
7 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.
  • D Offline
    D Offline
    DKalepu
    wrote on last edited by
    #1

    Hi, I have two windows application forms(form1 & form2).. In the form1 i hv a textbox asking for phonenumber. When ever user enters the phone no. in the text box, I want to display that data(ph. no) in Form2.. IS this possible by any way? if so, how can I achieve it? Could any one please shed some light on it..... Thanks in Advance. :) -- modified at 6:20 Thursday 28th June, 2007

    C C 2 Replies Last reply
    0
    • D DKalepu

      Hi, I have two windows application forms(form1 & form2).. In the form1 i hv a textbox asking for phonenumber. When ever user enters the phone no. in the text box, I want to display that data(ph. no) in Form2.. IS this possible by any way? if so, how can I achieve it? Could any one please shed some light on it..... Thanks in Advance. :) -- modified at 6:20 Thursday 28th June, 2007

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

      These are web forms ? You can store data in the session, put it on the URL, or do a cross page postback.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      D 1 Reply Last reply
      0
      • C Christian Graus

        These are web forms ? You can store data in the session, put it on the URL, or do a cross page postback.

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        D Offline
        D Offline
        DKalepu
        wrote on last edited by
        #3

        sorry, i mean to say windows application forms... like form1.cs & form2.cs sorry again...:-O

        M 1 Reply Last reply
        0
        • D DKalepu

          sorry, i mean to say windows application forms... like form1.cs & form2.cs sorry again...:-O

          M Offline
          M Offline
          Manas Bhardwaj
          wrote on last edited by
          #4

          Create a property/variable in Form2. Assign phone number to it.

          1 Reply Last reply
          0
          • D DKalepu

            Hi, I have two windows application forms(form1 & form2).. In the form1 i hv a textbox asking for phonenumber. When ever user enters the phone no. in the text box, I want to display that data(ph. no) in Form2.. IS this possible by any way? if so, how can I achieve it? Could any one please shed some light on it..... Thanks in Advance. :) -- modified at 6:20 Thursday 28th June, 2007

            C Offline
            C Offline
            Chintan Desai
            wrote on last edited by
            #5

            Code snippets: Form1: string ph_no="121212"; Form2 frm2=new Form2(); frm2.ph_no=this.ph_no; frm2.Show(); Form2: public string ph_no; form_load() { Messagebox(ph_no); } :rose:

            Regards Chintan www.visharadsoft.com (Nothing is so purify as KNOWLEDGE)

            D 1 Reply Last reply
            0
            • C Chintan Desai

              Code snippets: Form1: string ph_no="121212"; Form2 frm2=new Form2(); frm2.ph_no=this.ph_no; frm2.Show(); Form2: public string ph_no; form_load() { Messagebox(ph_no); } :rose:

              Regards Chintan www.visharadsoft.com (Nothing is so purify as KNOWLEDGE)

              D Offline
              D Offline
              DKalepu
              wrote on last edited by
              #6

              Hi, Thanks for your reply... but its giving me this error:: "An unhandled exception of type 'System.StackOverflowException' occurred" Thanks..

              L 1 Reply Last reply
              0
              • D DKalepu

                Hi, Thanks for your reply... but its giving me this error:: "An unhandled exception of type 'System.StackOverflowException' occurred" Thanks..

                L Offline
                L Offline
                Luc Pattyn
                wrote on last edited by
                #7

                Most likely cause is: the set part of your property is assigning a new value to the property itself, rathet than to some local variable (upper/lower case!). :)

                Luc Pattyn [My Articles] [Forum Guidelines]

                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