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. C#
  4. Drop Down List Issue

Drop Down List Issue

Scheduled Pinned Locked Moved C#
questionhelp
2 Posts 2 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.
  • S Offline
    S Offline
    sebogawa
    wrote on last edited by
    #1

    I have part of my app which enumerates all video camera devices present and presents them in a drop down list. I have two Logitech web cams which have the same name, but when I click on the drop down button, only one of the cameras are listed. How do I make it so that both are displayed? If possible, how can I add a number or ideally a port number to differentiate the two instances of the web cams? This is my code: <pre>    public MainForm()             {                   InitializeComponent();                   // collect cameras list                   try                   {                         // enumerate video devices                         videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);                         if (videoDevices.Count == 0)                               throw new ApplicationException();                         // add all devices to combo                         foreach (FilterInfo device in videoDevices)                         {                               camerasComboLeft.Items.Add(device.Name);                               camerasComboRight.Items.Add(device.Name);                         }                         camerasComboLeft.SelectedIndex = 0;           &nb

    C 1 Reply Last reply
    0
    • S sebogawa

      I have part of my app which enumerates all video camera devices present and presents them in a drop down list. I have two Logitech web cams which have the same name, but when I click on the drop down button, only one of the cameras are listed. How do I make it so that both are displayed? If possible, how can I add a number or ideally a port number to differentiate the two instances of the web cams? This is my code: <pre>    public MainForm()             {                   InitializeComponent();                   // collect cameras list                   try                   {                         // enumerate video devices                         videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);                         if (videoDevices.Count == 0)                               throw new ApplicationException();                         // add all devices to combo                         foreach (FilterInfo device in videoDevices)                         {                               camerasComboLeft.Items.Add(device.Name);                               camerasComboRight.Items.Add(device.Name);                         }                         camerasComboLeft.SelectedIndex = 0;           &nb

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I guess you need to check if the name is already in the list, and if so, append a number to the name. In that instance, I am assuming you need to add the FilterInfo to the combo box, and set the DisplayMember to be the Name property, otherwise, how do you tell which is which, if not by name ?

      Christian Graus Driven to the arms of OSX by Vista. Please read this[^] if you don't like the answer I gave to your question.

      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