1.11M Members

closing a form and saving

 
0
 

i have a form with a listbox. the listbox can be edited (things added/deleted) and when the form is closed i would like the items in the listbox to be saved when the red "x" in the top right corner is clicked

any ideas?

 
-1
 

Use the FormClosing event.

Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        '// save code here.
    End Sub
 
0
 

Try putting the save code in the Forms FormClosing Event.

Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
   'Do Save stuff
  End Sub
 
0
 

Thanks for the down vote after I up voted yours> I will remember that for future posts I see of yours

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: