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. ComboBox problem

ComboBox problem

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
6 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.
  • N Offline
    N Offline
    naramis
    wrote on last edited by
    #1

    Hi guys, How to lock the text portion of the ComboBox, but at the same time allows the items from the drop down list to be selected? Meaning that it only allows the selection of items but does not allow the text to be edited manually by users. I already set the Locked Property to TRUE but it didn't work. It locked both the text editing as well as the selection item from the list..HELP!!! Nway, im using VB6. Really appreciate your help.. Thanx in advance.

    C 1 Reply Last reply
    0
    • N naramis

      Hi guys, How to lock the text portion of the ComboBox, but at the same time allows the items from the drop down list to be selected? Meaning that it only allows the selection of items but does not allow the text to be edited manually by users. I already set the Locked Property to TRUE but it didn't work. It locked both the text editing as well as the selection item from the list..HELP!!! Nway, im using VB6. Really appreciate your help.. Thanx in advance.

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

      I'm not sure what you mean ? If you don't allow typing, the user can just select items from the list.  If you allow typing, they can type anything they want.  What behaviour do you want to allow ? If you want to let them type in only stuff from the list, you need to write a custom control ( shouldn't be hard )

      Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert

      N 1 Reply Last reply
      0
      • C Christian Graus

        I'm not sure what you mean ? If you don't allow typing, the user can just select items from the list.  If you allow typing, they can type anything they want.  What behaviour do you want to allow ? If you want to let them type in only stuff from the list, you need to write a custom control ( shouldn't be hard )

        Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert

        N Offline
        N Offline
        naramis
        wrote on last edited by
        #3

        Thanx Christian, But actually the behavior that i want is that the program does not allow the user to edit the ComboBox text, instead the user can only select the item from the ComboBox list. Thanx for ur help and i apologize for any inconvenient.

        C 1 Reply Last reply
        0
        • N naramis

          Thanx Christian, But actually the behavior that i want is that the program does not allow the user to edit the ComboBox text, instead the user can only select the item from the ComboBox list. Thanx for ur help and i apologize for any inconvenient.

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

          OK, that's easy, set the behaviour from DropDown to DropDownList.

          Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert

          N 1 Reply Last reply
          0
          • C Christian Graus

            OK, that's easy, set the behaviour from DropDown to DropDownList.

            Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert

            N Offline
            N Offline
            naramis
            wrote on last edited by
            #5

            I tried using the DropDownList already and it works.. thanx a lot.. Btw, i used this in the main form. After selecting the item in the ComboBox list, a new form will appear. Then after closing the new form, it will return back to the main form. So when the program return to the main form, is it possible to empty the text in the ComboBox when using the DropDownList behavior?

            C 1 Reply Last reply
            0
            • N naramis

              I tried using the DropDownList already and it works.. thanx a lot.. Btw, i used this in the main form. After selecting the item in the ComboBox list, a new form will appear. Then after closing the new form, it will return back to the main form. So when the program return to the main form, is it possible to empty the text in the ComboBox when using the DropDownList behavior?

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

              You can set the selecteditem, not sure if you can select selectedText or Text.  SelectedIndex = -1 may work.

              Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert

              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