unselecting a listbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jesse07
    New Member
    • Sep 2007
    • 18

    unselecting a listbox

    I have 6 seperate listbox and I want the user to select 1 value from 1 of the 6 boxes. The problem is after the user clicks the listbox1 then listbox2, listbox1 still says highlighted. I want to "unclick" or deselct the line from listbox1 when the user selects listbox2.

    Any suggestions?
  • jamesd0142
    Contributor
    • Sep 2007
    • 471

    #2
    Originally posted by jesse07
    I have 6 seperate listbox and I want the user to select 1 value from 1 of the 6 boxes. The problem is after the user clicks the listbox1 then listbox2, listbox1 still says highlighted. I want to "unclick" or deselct the line from listbox1 when the user selects listbox2.

    Any suggestions?
    try something along the lines of 'listbox1.selec teditem = false' or 'listbox1.selec teditem = -1' put this code on the listbox2 changed event (ie double click list box 2)

    Comment

    • jesse07
      New Member
      • Sep 2007
      • 18

      #3
      It worked on my version at work. I will try it when I get home. I swear I did this last night but my eyes & brain were a little strained at that point.

      Thanks

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by jesse07
        It worked on my version at work. I will try it when I get home. I swear I did this last night but my eyes & brain were a little strained at that point.
        Just from memory, doesn't the listbox have a MultiSelect property? I imagine this might affect the behaviour, so perhaps that was set differently.

        Comment

        • jamesd0142
          Contributor
          • Sep 2007
          • 471

          #5
          Yes killer I believe you are correct... again ;)

          Anyways how about using combo box instead? Then you can say cbobox1.selecte ditem = -1

          Thanks

          Comment

          • QVeen72
            Recognized Expert Top Contributor
            • Oct 2006
            • 1445

            #6
            Originally posted by jamesd0142
            cbobox1.selecte ditem = -1
            It should be :
            cbobox1.ListInd ex = -1

            Comment

            • jamesd0142
              Contributor
              • Sep 2007
              • 471

              #7
              Originally posted by QVeen72
              it shud be :
              cbobox1.ListInd ex = -1
              Much appriciated...

              i find this works...
              ComboBox1.Selec tedIndex = -1

              thank you ;)

              Comment

              Working...