We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,858 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

closing a form and saving

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?

3
Contributors
3
Replies
3 Days
Discussion Span
1 Year Ago
Last Updated
4
Views
ng5
Light Poster
42 posts since Dec 2011
Reputation Points: 19
Solved Threads: 0
Skill Endorsements: 0

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
codeorder
Postaholic
2,124 posts since Aug 2010
Reputation Points: 256
Solved Threads: 387
Skill Endorsements: 8

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
Phasma
Junior Poster in Training
81 posts since Nov 2008
Reputation Points: 21
Solved Threads: 21
Skill Endorsements: 0

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

Phasma
Junior Poster in Training
81 posts since Nov 2008
Reputation Points: 21
Solved Threads: 21
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0828 seconds using 2.69MB