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. refrest the windows application form

refrest the windows application form

Scheduled Pinned Locked Moved C#
databasehelpquestion
3 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.
  • S Offline
    S Offline
    Sadaf Naeem
    wrote on last edited by
    #1

    Hello friends in my windows form , there is a listbox which gets filled on the form load event. on the button click event, the item selected in the listbox is deleted from the database and message box appears telling that the this item has been removed from the database the problem is that I want that after the messagebox is closed, the list box should be refreshed now holding the items that are now currently in the databse and the item I have just deleted should not appear in the listbox. How will I achieve this? Looking forward for ur kind suggestions on the problem. Thanks

    Sadaf

    G R 2 Replies Last reply
    0
    • S Sadaf Naeem

      Hello friends in my windows form , there is a listbox which gets filled on the form load event. on the button click event, the item selected in the listbox is deleted from the database and message box appears telling that the this item has been removed from the database the problem is that I want that after the messagebox is closed, the list box should be refreshed now holding the items that are now currently in the databse and the item I have just deleted should not appear in the listbox. How will I achieve this? Looking forward for ur kind suggestions on the problem. Thanks

      Sadaf

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      Clear the contents of the listbox and fill it again. You can also just remove the item you have just deleted but in that case listbox won't contain any items that have been added after your programs startup and will contain items that have been deleted by other users.

      Giorgi Dalakishvili #region signature my articles #endregion

      1 Reply Last reply
      0
      • S Sadaf Naeem

        Hello friends in my windows form , there is a listbox which gets filled on the form load event. on the button click event, the item selected in the listbox is deleted from the database and message box appears telling that the this item has been removed from the database the problem is that I want that after the messagebox is closed, the list box should be refreshed now holding the items that are now currently in the databse and the item I have just deleted should not appear in the listbox. How will I achieve this? Looking forward for ur kind suggestions on the problem. Thanks

        Sadaf

        R Offline
        R Offline
        Rocky
        wrote on last edited by
        #3

        re-populate the list box again from the Database. thats the safest way I think

        Rocky Success is a ladder which you can't climb with your hands in your pockets.

        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