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. calling ShowDialog()

calling ShowDialog()

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

    i am calling showDialog() for form2 from form 1 i want if i close the form2 changes made in form2 appears in form 1 it is fullfillng my requirement for first time but when i call showdialog() 2nd time and malke some chnaging in form 2 it does not appears in form 1....how to solve this problem?

    P OriginalGriffO 2 Replies Last reply
    0
    • M MahaKh

      i am calling showDialog() for form2 from form 1 i want if i close the form2 changes made in form2 appears in form 1 it is fullfillng my requirement for first time but when i call showdialog() 2nd time and malke some chnaging in form 2 it does not appears in form 1....how to solve this problem?

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      You haven't provided anywhere near enough information to answer this question. What does your code look like? How are you triggering the update? All this information is needed.

      Forgive your enemies - it messes with their heads

      "Mind bleach! Send me mind bleach!" - Nagy Vilmos

      My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

      M 1 Reply Last reply
      0
      • M MahaKh

        i am calling showDialog() for form2 from form 1 i want if i close the form2 changes made in form2 appears in form 1 it is fullfillng my requirement for first time but when i call showdialog() 2nd time and malke some chnaging in form 2 it does not appears in form 1....how to solve this problem?

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

        ShowDialog displays the form and waits for the user to close it with OK or Cancel before it returns. When it does, you can get the changed values from the form instance:

        MyForm mf = new myForm();
        mf.StringValue = "Hello";
        if (mf.ShowDialog() == DialogResult.OK)
        {
        Console.WriteLine(mf.StringValue);
        }
        mf.StringValue = "Goodbye";
        if (mf.ShowDialog() == DialogResult.OK)
        {
        Console.WriteLine(mf.StringValue);
        }

        Works fine for me: What are you doing that is different?

        Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

        "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
        • P Pete OHanlon

          You haven't provided anywhere near enough information to answer this question. What does your code look like? How are you triggering the update? All this information is needed.

          Forgive your enemies - it messes with their heads

          "Mind bleach! Send me mind bleach!" - Nagy Vilmos

          My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

          M Offline
          M Offline
          MahaKh
          wrote on last edited by
          #4

          both forms have text boxes and check boxes data is updated in database and fecthing is from sql qries and set into fom1 textboxes

          P 1 Reply Last reply
          0
          • M MahaKh

            both forms have text boxes and check boxes data is updated in database and fecthing is from sql qries and set into fom1 textboxes

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            And still no code. As it's the code that's wrong, don't you think that you should provide that or are you happy for us to throw random guesses around in the hope that one of them sticks like dung to a wall?

            Forgive your enemies - it messes with their heads

            "Mind bleach! Send me mind bleach!" - Nagy Vilmos

            My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

            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