Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. List Boxes

List Boxes

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Glen Conaway
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • G 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

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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

      G 1 Reply Last reply
      0
      • D Dave Kreskowiak

        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

        G Offline
        G Offline
        Glen Conaway
        wrote on last edited by
        #3

        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

        N 1 Reply Last reply
        0
        • G 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

          N Offline
          N Offline
          Name Removed
          wrote on last edited by
          #4

          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

          G D 2 Replies Last reply
          0
          • N Name Removed

            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

            G Offline
            G Offline
            Glen Conaway
            wrote on last edited by
            #5

            Works great. Many thanks, Glen Conaway

            1 Reply Last reply
            0
            • N Name Removed

              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

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups