Save Listview Data On Form Closing

Save Listview Data On Form Closing

Page 1 of 1

3 Replies - 5076 Views - Last Post: 25 December 2010 - 02:33 PM Rate Topic: -----

#1 BJseal91  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 68
  • Joined: 18-April 09

Save Listview Data On Form Closing

Posted 23 December 2010 - 03:54 AM

Below is a project that I am creating and need help with it is a listview table with name and telephone number I can add and remove contacts no problem that part is solved

Attached Image

What I am trying to solve the problem to is how to save that data once the form is closed and be at the same point when I close the form

Save Settings

Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        'Save Settings
        My.Settings.MyText = listview1.Text




Load Settings

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Load Settings
        listview1.Text = My.Settings.MyText



I saved the following in my settings on project propeties

any help or advise on how to do it diffrently would be gratfully appricated

Kind Regards

Bradley

Is This A Good Question/Topic? 0
  • +

Replies To: Save Listview Data On Form Closing

#2 BJseal91  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 68
  • Joined: 18-April 09

Re: Save Listview Data On Form Closing

Posted 25 December 2010 - 02:01 AM

Dear Admin and Modorators of Deamincode.net
Please would you be so kind as to remove my topic as there is no remove or delete topic button as no one can answer the question the topic might as well be deleted

Kindist Regards

BJseal91
Was This Post Helpful? 0
  • +
  • -

#3 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: Save Listview Data On Form Closing

Posted 25 December 2010 - 06:25 AM

How are you storing these contacts, (ie, Database, Flat File...?) You will need; upon opening the form, access that file and re-populate the listview from your stored data.

As for removing your post, they don't do that. Also, keep in mind, this is a public forum where people out of the kindness of their heart answer your questions. Some questions may sit for a while before someone comes along that either has the time or the knowledge to help. This time of year, people get busy with the holidays and your question may not get answered for a while. Be patient, there are plenty of people that frequent this forum who can get your problem resolved.

This post has been edited by CharlieMay: 25 December 2010 - 06:29 AM

Was This Post Helpful? 0
  • +
  • -

#4 biggerB  Icon User is offline

  • If at first you donít succeed, call it version 1.0
  • member icon

Reputation: 80
  • View blog
  • Posts: 760
  • Joined: 11-June 10

Re: Save Listview Data On Form Closing

Posted 25 December 2010 - 02:33 PM

The solution is simple...
Make a text file In which you could store one number on each line, seperate the name and the number using a comma "," and this would become a comma separated file, if you set its extension to .csv then you can even open it in excel or something, However this file would be completely open to anyone, if you want more security you could explore other options such as a database..
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1