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. Windows Forms
  4. Passing Data Betwen Forms

Passing Data Betwen Forms

Scheduled Pinned Locked Moved Windows Forms
questioncsharpwinformsannouncement
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.
  • K Offline
    K Offline
    Kit Fisto
    wrote on last edited by
    #1

    Hi everyone. I'm new to programing and i have a question. I have a winforms mdi application. Let's say my parent form is form1. From form1 a call a child (form2) and i want to use a DataTable from form1 in form2. Ok i'ved made a reference to form1 in form2. But my question is: I have a form3 being called from form2 and in that form3 want to update data in the DataTable from form1. How can i make this? :doh: Thanks in advance. :)

    Z D C 3 Replies Last reply
    0
    • K Kit Fisto

      Hi everyone. I'm new to programing and i have a question. I have a winforms mdi application. Let's say my parent form is form1. From form1 a call a child (form2) and i want to use a DataTable from form1 in form2. Ok i'ved made a reference to form1 in form2. But my question is: I have a form3 being called from form2 and in that form3 want to update data in the DataTable from form1. How can i make this? :doh: Thanks in advance. :)

      Z Offline
      Z Offline
      Zoltan Balazs
      wrote on last edited by
      #2

      You should use properties, events and that kind of stuff for that.

      1 Reply Last reply
      0
      • K Kit Fisto

        Hi everyone. I'm new to programing and i have a question. I have a winforms mdi application. Let's say my parent form is form1. From form1 a call a child (form2) and i want to use a DataTable from form1 in form2. Ok i'ved made a reference to form1 in form2. But my question is: I have a form3 being called from form2 and in that form3 want to update data in the DataTable from form1. How can i make this? :doh: Thanks in advance. :)

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        You might want to read this[^] little article.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        1 Reply Last reply
        0
        • K Kit Fisto

          Hi everyone. I'm new to programing and i have a question. I have a winforms mdi application. Let's say my parent form is form1. From form1 a call a child (form2) and i want to use a DataTable from form1 in form2. Ok i'ved made a reference to form1 in form2. But my question is: I have a form3 being called from form2 and in that form3 want to update data in the DataTable from form1. How can i make this? :doh: Thanks in advance. :)

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

          Ice_LS00 wrote:

          Ok i'ved made a reference to form1 in form2

          Don't ever do that. Use delegates.

          Christian Graus Please read this if you don't understand the answer I've given you "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 )

          K 1 Reply Last reply
          0
          • C Christian Graus

            Ice_LS00 wrote:

            Ok i'ved made a reference to form1 in form2

            Don't ever do that. Use delegates.

            Christian Graus Please read this if you don't understand the answer I've given you "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 )

            K Offline
            K Offline
            Kit Fisto
            wrote on last edited by
            #5

            Thank you guys. Delegates..... How did i never tought on that.... :) You just rocked my world :omg: But i still have a doubt. I have read the article about the delegates and found it very useful, but it doesn't solves my problem. I have a frmMain that calls a child. That childs calls a new child and in that second child i need to update the main. Like this (frmMain - calls - frmChild1 - calls - frmChild2 - updates - frmMain). Does any one know how to resolve this? Thanks in advance.

            modified on Tuesday, April 15, 2008 7:03 AM

            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