Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell list view Question 1

Status
Not open for further replies.

genoah

Programmer
Nov 1, 2001
24
US
I am new to Delphi 6. I understand how to load a file say to a memo field from file list box, but I am having problems loading a file to a memo field from Shell List View. I can use something like 'memo1.lines.LoadFromFile (filelistbox1.filename)'. Can anyone please give me a hint or push me in the right direction?
 
You wrote it!

Code:
memo1.lines.LoadFromFile (filelistbox1.filename)

That is exactly it! You will find that lots of things are TStrings (like TMemo.Lines) and you treat them all the same.

Cheers
 
Thank you for your reply, but that works with file list box. It doesnt work with shell list view. I want to use the shell list view and load from there.
 
genoah,

Richard's got the right idea. What you're missing is what gives you the selected file name from the ShellListView.

Consider the following code sample:

Code:
with ShellListView1 do
   Memo1.Lines.loadFromFile( Folders[ ItemIndex ].PathName );

The more verbose version of that code may be more clear:

Code:
Memo1.Lines.loadFromFile( 
   ShellListView1.Folders[ 
      ShellListView1.ItemIndex ].PathName );

Hope this helps...

-- Lance
 
Thank you very much! It worked great!............


Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top