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?
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?
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
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
Thanks for the down vote after I up voted yours> I will remember that for future posts I see of yours
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.