[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Save listitems to file!

Posted on 1999-12-01
3
Medium Priority
?
293 Views
Last Modified: 2010-04-04
Hi experts:
I want to find a easy way to save my listitems(i use listview component)to file as they show to me.Listview items are dynamic and i want to show 50 items on screen.
0
Comment
Question by:mingwei
3 Comments
 
LVL 4

Expert Comment

by:jeurk
ID: 2246000
Hi,
use the rxlib (www.rxlib.com)
in it, the component called formstorage.
Drop it on the form. Double click on
it. select your listview and the items
property.
It will automaticaly save you items
even those added dynamically.
This is an easy answer, if you are using
that library ;)
0
 
LVL 1

Accepted Solution

by:
men xin earned 150 total points
ID: 2246777
mingwei

I think it is not defficult,i can give you some lines...

var i:integer;
begin
  ListView1.Items.Clear;
  for i:=0 to Memo1.Lines.Count-1 do
    with ListView1.Items.Add do
      Caption:=Memo1.Lines[i];
  Memo1.Clear;
  ShowMessage('load listview.itemscaption to memo.');
  for i:=0 to ListView1.Items.Count-1 do
    Memo1.Lines.Add(ListView1.Items[i].Caption);
    Memo1.Lines.SaveToFile('c:\listitems.txt');

Of couse,it is not easy such this if you use subitem...,but it is not defficult....


Good luck

menxin
0
 

Author Comment

by:mingwei
ID: 2251828
It works anyway!Thank!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This is an update to some code that someone else posted on Experts Exchange. It is an alternate approach, I think a little easier to use, & makes sure that things like the Task Bar will update.
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
Suggested Courses
Course of the Month9 days, 19 hours left to enroll

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question