Results 1 to 2 of 2

Thread: [2005] How to automatically select a file in a listview when it's opened

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    115

    [2005] How to automatically select a file in a listview when it's opened

    I have a mp3 player and have my btnPlay setup to play the selected item.text and it works. My problem is that when I open some songs in the listview from my openfiledialog that the first one in the list gets selected then btnPlay.performclick and play the song. If there's another way to do it i'd like to know that one to if possible hopefully somebody can help me.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] How to automatically select a file in a listview when it's opened

    The button click is irrelevant. The code inside the button's Click event handler is the code that palys the song. You can take that code out of the event handler and put it in its own method, then call that method from wherever you want to to play the song.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width