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. Combo box -- Locking

Combo box -- Locking

Scheduled Pinned Locked Moved C#
4 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.
  • B Offline
    B Offline
    Biswajit Ghosh
    wrote on last edited by
    #1

    I just added three items in combo box and I made the SelectedIndex = 0. I would like to lock the combo box so that the user not be able to select other than the first item.

    L 1 Reply Last reply
    0
    • B Biswajit Ghosh

      I just added three items in combo box and I made the SelectedIndex = 0. I would like to lock the combo box so that the user not be able to select other than the first item.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Just set comboBox.Enabled = false;

      B 1 Reply Last reply
      0
      • L Lost User

        Just set comboBox.Enabled = false;

        B Offline
        B Offline
        Biswajit Ghosh
        wrote on last edited by
        #3

        I dont like to make the enable property to false. I just want the combox to be visible and the user can show all the items in it. But will not be able to select any items from it(combo box).

        S 1 Reply Last reply
        0
        • B Biswajit Ghosh

          I dont like to make the enable property to false. I just want the combox to be visible and the user can show all the items in it. But will not be able to select any items from it(combo box).

          S Offline
          S Offline
          sharpiesharpie
          wrote on last edited by
          #4

          private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { comboBox1.SelectedIndex = 0; }

          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