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. data through multi forms

data through multi forms

Scheduled Pinned Locked Moved C#
databasequestionhelptutorial
3 Posts 2 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.
  • C Offline
    C Offline
    crash893
    wrote on last edited by
    #1

    hi all I am making a second form to help the user enter info that will go into a sql query I have seen many examples to pass info TO a new form but i haven't really seen anything about how to pass the info back. I am currently using a public string hold the info in form1 but it seems to me that there must be a better way to pass the info back something more like a return or something like that My other question is that is there anyway i can triger an event when form2 closes?

    C 1 Reply Last reply
    0
    • C crash893

      hi all I am making a second form to help the user enter info that will go into a sql query I have seen many examples to pass info TO a new form but i haven't really seen anything about how to pass the info back. I am currently using a public string hold the info in form1 but it seems to me that there must be a better way to pass the info back something more like a return or something like that My other question is that is there anyway i can triger an event when form2 closes?

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

      A delegate is the best way to pass data back. It's also an event, so it's the way to tell form1 that form2 has closed, assuming it's modeless.

      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 )

      C 1 Reply Last reply
      0
      • C Christian Graus

        A delegate is the best way to pass data back. It's also an event, so it's the way to tell form1 that form2 has closed, assuming it's modeless.

        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 )

        C Offline
        C Offline
        crash893
        wrote on last edited by
        #3

        could you give me a simple example

        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