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. How to disable item editing in combobox?vb.Net

How to disable item editing in combobox?vb.Net

Scheduled Pinned Locked Moved Visual Basic
csharphelptutorialquestion
5 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.
  • M Offline
    M Offline
    MJay
    wrote on last edited by
    #1

    the default setting of combo box enable user to edit the listed in combobox just like normal textbox, but i cant find any property that can disable this option, i wan the combobox to be read-only to user...how i going to do that?? anyone can help me??VB.Net

    C 1 Reply Last reply
    0
    • M MJay

      the default setting of combo box enable user to edit the listed in combobox just like normal textbox, but i cant find any property that can disable this option, i wan the combobox to be read-only to user...how i going to do that?? anyone can help me??VB.Net

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Try this:

      Me.ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList

      Or just set it in the designer. The defintions for ComboBoxStyle are: DropDown The text portion is editable. The user must click the arrow button to display the list portion. DropDownList The user cannot directly edit the text portion. The user must click the arrow button to display the list portion. Simple The text portion is editable. The list portion is always visible. --Colin Mackay--

      "In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown) Enumerators in .NET: See how to customise foreach loops with C#

      M 1 Reply Last reply
      0
      • C Colin Angus Mackay

        Try this:

        Me.ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList

        Or just set it in the designer. The defintions for ComboBoxStyle are: DropDown The text portion is editable. The user must click the arrow button to display the list portion. DropDownList The user cannot directly edit the text portion. The user must click the arrow button to display the list portion. Simple The text portion is editable. The list portion is always visible. --Colin Mackay--

        "In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown) Enumerators in .NET: See how to customise foreach loops with C#

        M Offline
        M Offline
        MJay
        wrote on last edited by
        #3

        thanks man, ur solution works! however seems like the combobox will no default value when form loaded, the combobox is empty how i going to set the first item in the combobox to be the default item when form is loaded?

        C 1 Reply Last reply
        0
        • M MJay

          thanks man, ur solution works! however seems like the combobox will no default value when form loaded, the combobox is empty how i going to set the first item in the combobox to be the default item when form is loaded?

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          Use SelectedIndex or SelectedText --Colin Mackay--

          "In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown) Enumerators in .NET: See how to customise foreach loops with C#

          M 1 Reply Last reply
          0
          • C Colin Angus Mackay

            Use SelectedIndex or SelectedText --Colin Mackay--

            "In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown) Enumerators in .NET: See how to customise foreach loops with C#

            M Offline
            M Offline
            MJay
            wrote on last edited by
            #5

            thanks man, u helped me alot, i am a beginner in vb.net hope the questions i asked wont make u feel boring...

            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