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. Combo Box row selected

Combo Box row selected

Scheduled Pinned Locked Moved Visual Basic
question
3 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.
  • D Offline
    D Offline
    directred
    wrote on last edited by
    #1

    I have a list of records in a combo box. How do I get the selected row number e.g. In combo box have the following A B C D If I select C then that is the 3rd row. How do I display that I selected the 3rd row. Thanks in advance

    T S 2 Replies Last reply
    0
    • D directred

      I have a list of records in a combo box. How do I get the selected row number e.g. In combo box have the following A B C D If I select C then that is the 3rd row. How do I display that I selected the 3rd row. Thanks in advance

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      see SelectedItem() and SelectedIndex() hey, did you search a bit?


      TOXCCT >>> GEII power
      [toxcct][VisualCalc]

      1 Reply Last reply
      0
      • D directred

        I have a list of records in a combo box. How do I get the selected row number e.g. In combo box have the following A B C D If I select C then that is the 3rd row. How do I display that I selected the 3rd row. Thanks in advance

        S Offline
        S Offline
        StealthMaker
        wrote on last edited by
        #3

        combobox1.selectedindex + 1 = the row number its +1 cause combobox index starts at 0 so the first item is at index 0 and the last is at count-1 in other words assuming the combobox is called combobox1 and the output is going to be in label1 Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Label1.Text = "You Clicked On row " & (ComboBox1.SelectedIndex + 1).ToString End Sub

        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