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. Refresh form1 from form2

Refresh form1 from form2

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

    Dear developers, I am coding a very small project for my study. I want to refresh form1 after form2 is closed. For example, I open form1 and click one button to open form2 and in form2 I can insert data to the database (ex : tblItem). In addition, combobox in form1 retrieves data from the database (tblItem) too. So, after inserting data from form2 and when I close the form2, I want the comboxbox in form1 refresh to retrieve the last update of tblItem data. Please advise, thanks. Visoth

    Chuon Visoth Angkor Wat - Cambodia asp.net - c sharp beginner

    N 1 Reply Last reply
    0
    • M misCafe

      Dear developers, I am coding a very small project for my study. I want to refresh form1 after form2 is closed. For example, I open form1 and click one button to open form2 and in form2 I can insert data to the database (ex : tblItem). In addition, combobox in form1 retrieves data from the database (tblItem) too. So, after inserting data from form2 and when I close the form2, I want the comboxbox in form1 refresh to retrieve the last update of tblItem data. Please advise, thanks. Visoth

      Chuon Visoth Angkor Wat - Cambodia asp.net - c sharp beginner

      N Offline
      N Offline
      Nicholas Butler
      wrote on last edited by
      #2

      How are you showing form2? If you use form2.ShowDialog(), it won't return until you close form2, so you can just add code after this line in form1. Nick

      ---------------------------------- Be excellent to each other :)

      M 1 Reply Last reply
      0
      • N Nicholas Butler

        How are you showing form2? If you use form2.ShowDialog(), it won't return until you close form2, so you can just add code after this line in form1. Nick

        ---------------------------------- Be excellent to each other :)

        M Offline
        M Offline
        misCafe
        wrote on last edited by
        #3

        Let's see my code. form2 frmitem = new form2(); frmitem.ShowDialog(); Many thanks, :)

        Chuon Visoth Angkor Wat - Cambodia asp.net - c sharp beginner

        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