Using the listview itemactivate event

  • Thread starter Thread starter Bernie Yaeger
  • Start date Start date
B

Bernie Yaeger

When I double click an item (filename) in a listview, the itemactive event
is fired. How can I code it such that the item selected will be launched by
the default program for that file extension (eg, Word with a .doc file,
Photoshop with a .jpg file, etc)?

Thanks for any help.

Bernie Yaeger
 
In the doubleclick event, you can simply call:
Shell("Start <fully qualified file name>")

For example, for a file mydoc.doc on c:\, you would make a call:
Shell("Start c:\mydoc.doc")

This will cause windows to load file with the default program for that file
extension. In your case, you'll be getting the filename from the listview
items.

hope that helps..
Imran.
 
Hi Imran,

Tx for your help.

Bernie

Imran Koradia said:
In the doubleclick event, you can simply call:
Shell("Start <fully qualified file name>")

For example, for a file mydoc.doc on c:\, you would make a call:
Shell("Start c:\mydoc.doc")

This will cause windows to load file with the default program for that
file extension. In your case, you'll be getting the filename from the
listview items.

hope that helps..
Imran.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top