List Boxes
-
I am trying to play and increment tracks in a listbox control with the windows media player active x control (OCX). The following line of code will play a selected item. AxWindowsMediaPlayer1.URL = ListBox1.SelectedItem I need to be able to start from a point in the listbox, for example the third track, with out selecting it with the mouse, and then I need to play and increment through the tracks. The following line gives me an error that the list box has no default property: AXWindowsMediaPlayer1.URL = ListBox1(3) Any sugestions? Many thanks, Glen Conaway
-
I am trying to play and increment tracks in a listbox control with the windows media player active x control (OCX). The following line of code will play a selected item. AxWindowsMediaPlayer1.URL = ListBox1.SelectedItem I need to be able to start from a point in the listbox, for example the third track, with out selecting it with the mouse, and then I need to play and increment through the tracks. The following line gives me an error that the list box has no default property: AXWindowsMediaPlayer1.URL = ListBox1(3) Any sugestions? Many thanks, Glen Conaway
It's right, there is no default property like there was in VB6. You have to use something like this:
AXWindowsMediaPlayer1.URL = ListBox1.Items(3).Text
RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
It's right, there is no default property like there was in VB6. You have to use something like this:
AXWindowsMediaPlayer1.URL = ListBox1.Items(3).Text
RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Ok, Thanks, But I still have a problem, I am getting the following error message: An unhandled exception of type 'System.MissingMemberException' occurred in microsoft.visualbasic.dll Additional information: Public member 'Text' on type 'String' not found. Many thanks, Glen Conaway
-
Ok, Thanks, But I still have a problem, I am getting the following error message: An unhandled exception of type 'System.MissingMemberException' occurred in microsoft.visualbasic.dll Additional information: Public member 'Text' on type 'String' not found. Many thanks, Glen Conaway
Glen Conaway wrote: Additional information: Public member 'Text' on type 'String' not found. The objects in ListBox.Items() are strings, so just try ListBox.Items(1), instead of ListBox.Items(1).Text. Hope This Helps
-
Glen Conaway wrote: Additional information: Public member 'Text' on type 'String' not found. The objects in ListBox.Items() are strings, so just try ListBox.Items(1), instead of ListBox.Items(1).Text. Hope This Helps
Works great. Many thanks, Glen Conaway
-
Glen Conaway wrote: Additional information: Public member 'Text' on type 'String' not found. The objects in ListBox.Items() are strings, so just try ListBox.Items(1), instead of ListBox.Items(1).Text. Hope This Helps
Sorry for the late reply, but yes, drop the .Text. That's what I get for writing this stuff when I'm in a hurry to get out of work! :rolleyes: RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome