TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Programing Languages > VB.NET

Notices

how to Automatically select next item in listbox

VB.NET


Reply
 
Thread Tools Display Modes
Old 28-09-2007, 10:36 PM   #1
kimiraikkonen
Guest
 
Posts: n/a
how to Automatically select next item in listbox

Hello,
I have a moodest mp3 player which has a playlist as listbox1 which
shows full path or each inserted file.

The problem is, when a media playing is ended, i want my listbox to
select automatically next (under/below) item to continue.

What things can i add to that code:

If Me.AxWindowsMediaPlayer1.playState =
WMPLib.WMPPlayState.wmppsMediaEnded Then


End if

  Reply With Quote
Old 28-09-2007, 10:36 PM   #2
rowe_newsgroups
Guest
 
Posts: n/a
Re: how to Automatically select next item in listbox

On Sep 28, 11:46 am, kimiraikkonen <> wrote:
> Hello,
> I have a moodest mp3 player which has a playlist as listbox1 which
> shows full path or each inserted file.
>
> The problem is, when a media playing is ended, i want my listbox to
> select automatically next (under/below) item to continue.
>
> What things can i add to that code:
>
> If Me.AxWindowsMediaPlayer1.playState =
> WMPLib.WMPPlayState.wmppsMediaEnded Then
>
> End if


Shouldn't it be:

Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1

You might want to do an if..then test to make sure you aren't at the
end of the List however.

Thanks,

Seth Rowe

  Reply With Quote
Old 28-09-2007, 11:36 PM   #3
kimiraikkonen
Guest
 
Posts: n/a
Re: how to Automatically select next item in listbox


>
> Shouldn't it be:
>
> Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1
>
> You might want to do an if..then test to make sure you aren't at the
> end of the List however.
>
> Thanks,
>
> Seth Rowe


Hi Seth Rowe,
Great it worked for selection next item, but i couldn't make out how
to automatize. Which event or action can it be assigned to?

If the playing media is stopped due to end of stream:

If Me.AxWindowsMediaPlayer1.playState =
WMPLib.WMPPlayState.wmppsMediaStopped Then
Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1

That code works for a button click action for example, but i want to
automatize selecting next item, without needing to user prompt or user
mouse action. (Like in Windows Media Player's playlist, Winamp's
playlist)



  Reply With Quote
Old 28-09-2007, 11:36 PM   #4
Cor Ligthert[MVP]
Guest
 
Posts: n/a
Re: how to Automatically select next item in listbox

kimiraikkonen,

You need an event from your mediaplayer for this which then can be handled.

Have a look in intelisense of the mediaplayer which there are.

Cor

"kimiraikkonen" <> schreef in bericht
news:1190996596.887719.289920@57g2000hsv.googlegro ups.com...
>
>>
>> Shouldn't it be:
>>
>> Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1
>>
>> You might want to do an if..then test to make sure you aren't at the
>> end of the List however.
>>
>> Thanks,
>>
>> Seth Rowe

>
> Hi Seth Rowe,
> Great it worked for selection next item, but i couldn't make out how
> to automatize. Which event or action can it be assigned to?
>
> If the playing media is stopped due to end of stream:
>
> If Me.AxWindowsMediaPlayer1.playState =
> WMPLib.WMPPlayState.wmppsMediaStopped Then
> Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1
>
> That code works for a button click action for example, but i want to
> automatize selecting next item, without needing to user prompt or user
> mouse action. (Like in Windows Media Player's playlist, Winamp's
> playlist)
>
>
>


  Reply With Quote
Old 29-09-2007, 12:34 AM   #5
kimiraikkonen
Guest
 
Posts: n/a
Re: how to Automatically select next item in listbox

On Sep 28, 7:42 pm, "Cor Ligthert[MVP]" <>
wrote:
> kimiraikkonen,
>
> You need an event from your mediaplayer for this which then can be handled.
>
> Have a look in intelisense of the mediaplayer which there are.
>
> Cor
>
> "kimiraikkonen" <> schreef in berichtnews: oglegroups.com...
>
>
>
>
>
> >> Shouldn't it be:

>
> >> Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1

>
> >> You might want to do an if..then test to make sure you aren't at the
> >> end of the List however.

>
> >> Thanks,

>
> >> Seth Rowe

>
> > Hi Seth Rowe,
> > Great it worked for selection next item, but i couldn't make out how
> > to automatize. Which event or action can it be assigned to?

>
> > If the playing media is stopped due to end of stream:

>
> > If Me.AxWindowsMediaPlayer1.playState =
> > WMPLib.WMPPlayState.wmppsMediaStopped Then
> > Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1

>
> > That code works for a button click action for example, but i want to
> > automatize selecting next item, without needing to user prompt or user
> > mouse action. (Like in Windows Media Player's playlist, Winamp's
> > playlist)- Hide quoted text -

>
> - Show quoted text -


Hi,
I looked avaible events with the help of intellisense but only
AxWindowsMediaPlayer1.enter seems valid, but it does not produce
automatize which i want. But a button click does what i wanted if you
assign button1.click action but, as i said i don't want any user
action as normal.

Thanks for the interest.

  Reply With Quote
Old 29-09-2007, 12:35 AM   #6
rowe_newsgroups
Guest
 
Posts: n/a
Re: how to Automatically select next item in listbox

On Sep 28, 1:09 pm, kimiraikkonen <> wrote:
> On Sep 28, 7:42 pm, "Cor Ligthert[MVP]" <>
> wrote:
>
>
>
> > kimiraikkonen,

>
> > You need an event from your mediaplayer for this which then can be handled.

>
> > Have a look in intelisense of the mediaplayer which there are.

>
> > Cor

>
> > "kimiraikkonen" <> schreef in berichtnews: oglegroups.com...

>
> > >> Shouldn't it be:

>
> > >> Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1

>
> > >> You might want to do an if..then test to make sure you aren't at the
> > >> end of the List however.

>
> > >> Thanks,

>
> > >> Seth Rowe

>
> > > Hi Seth Rowe,
> > > Great it worked for selection next item, but i couldn't make out how
> > > to automatize. Which event or action can it be assigned to?

>
> > > If the playing media is stopped due to end of stream:

>
> > > If Me.AxWindowsMediaPlayer1.playState =
> > > WMPLib.WMPPlayState.wmppsMediaStopped Then
> > > Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1

>
> > > That code works for a button click action for example, but i want to
> > > automatize selecting next item, without needing to user prompt or user
> > > mouse action. (Like in Windows Media Player's playlist, Winamp's
> > > playlist)- Hide quoted text -

>
> > - Show quoted text -

>
> Hi,
> I looked avaible events with the help of intellisense but only
> AxWindowsMediaPlayer1.enter seems valid, but it does not produce
> automatize which i want. But a button click does what i wanted if you
> assign button1.click action but, as i said i don't want any user
> action as normal.
>
> Thanks for the interest.


Hmm... unfortunately I've never to to use the AxWindowsMediaPlayer
active X object so I can't tell you what event to subscribe to. You
might go through the Object Browser and see if you can find any other
events or possible a field or property you can poll to find when it's
finished playing.

Thanks,

Seth Rowe

  Reply With Quote
Old 29-09-2007, 10:28 AM   #7
Cor Ligthert[MVP]
Guest
 
Posts: n/a
Re: how to Automatically select next item in listbox

Then use that button click and place a label before it, "Next to play".

Cor
  Reply With Quote
Old 01-10-2007, 05:31 AM   #8
kimiraikkonen
Guest
 
Posts: n/a
Re: how to Automatically select next item in listbox

On Sep 29, 6:34 am, "Cor Ligthert[MVP]" <>
wrote:
> Then use that button click and place a label before it, "Next to play".
>
> Cor


But everytime song finishes, user is forced to click next button to go
to next selected song. I want it automatic. Possible?

  Reply With Quote
Old 01-10-2007, 06:32 AM   #9
Armin Zingler
Guest
 
Posts: n/a
Re: how to Automatically select next item in listbox

"kimiraikkonen" <> schrieb
> On Sep 29, 6:34 am, "Cor Ligthert[MVP]" <>
> wrote:
> > Then use that button click and place a label before it, "Next to
> > play".
> >
> > Cor

>
> But everytime song finishes, user is forced to click next button to
> go to next selected song. I want it automatic. Possible?


As Cor and Seth said, if there is no event available, it is not possible
automatically.

You could add a Timer and check the state in it's Tick event. If it is
ended, select the next item (as shown).


Armin

  Reply With Quote
Old 09-10-2007, 09:46 PM   #10
Lim Eng Keong
Guest
 
Posts: n/a
Re: how to Automatically select next item in listbox

Use timer maybe?

"Cor Ligthert[MVP]" <> wrote in message
news:...
> Then use that button click and place a label before it, "Next to play".
>
> Cor


  Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Persistent Menu Item Stays on Screen After I Select it Jacob Sorensen Windows Vista All 5 04-01-2009 01:50 AM
Display multi line text as one item in a listbox ashwath C#(C Sharp) 2 18-09-2007 01:36 AM
ListBox vs GridBox darien.watkins@gmail.com VB.NET 1 15-09-2007 11:36 AM
unable to select options from a SELECT control Abhishek Tiwari Internet Explorer 1 28-08-2007 08:42 PM
unable to select options from a SELECT control Abhishek Tiwari Internet Explorer 1 28-08-2007 08:38 PM


< Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 06:59 AM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2009, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional