Re: Combobox - Stop (eliminate) Highlight of Item Upon Selection
Originally Posted by vb6forever
Title says it all.
Want to remove the selected item highlight after the user has made their selection.
Have tried number different ways but only thing seems to work
is with the user selecting another control.
Anyway?
If the Style is 2 (Dropdown List) it is highlighted not because it has something selected but because it has the focus.
If the Style is 0 (Dropdown Combo) just set .SelLenght = 0.
Re: Combobox - Stop (eliminate) Highlight of Item Upon Selection
OR, you can do this in whatever function you want to have the item deselected but still shown:
Code:
Dim cboText As String
cboText = Combo1.Text
Combo1.ListIndex = -1 '(if you just did this...then the combobox would be blank showing...so, reset it to what it was
Combo1.Text = cboText
Re: Combobox - Stop (eliminate) Highlight of Item Upon Selection
I'd be interested in a solution to this one too. Specifically, controlling the BackColor of a selected DropdownList.
I've managed to do it (with subclassing, and with substantial help credit to Bonnie West) for the ListView. I've spent a few minutes a couple of times in the past to try and do it for the DropdownList, but never gotten it up and running.
I'll post my ListView code if anyone would like. For the ListView, I specifically wanted it to keep showing the selected item, even when the control lost the focus. In other words, I wanted to have the look of the ListBox.
Best Regards,
Elroy
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
Re: Combobox - Stop (eliminate) Highlight of Item Upon Selection
Well, what I posted works for DD List as well...but as far as changing the BG Color...I'll have to look into that one. My post simply 'unhighlights' the 'selected' item in the combobox, defaulting to the BG color of the original cbobox.
EDIT---I didn't mean 'changing the BG color'---I know you meant changing the color of the SELECTED item onlyl....like I said, will have to experiment.
Re: Combobox - Stop (eliminate) Highlight of Item Upon Selection
Originally Posted by vb6forever
Eduardo and SamOscarBrown:
Could NOT get either idea to work.
Some Events need a decoupling (a "delayed reaction", usually done per Timer):
Code:
Option Explicit
Private Sub Form_Load()
Timer1.Enabled = False: Timer1.Interval = 15
Combo1.AddItem "A"
Combo1.AddItem "B"
Combo1.AddItem "C"
Combo1.ListIndex = 1
End Sub
Private Sub Combo1_Click()
Timer1.Enabled = (Combo1.ListIndex >= 0)
End Sub
Private Sub Timer1_Timer()
Timer1.Enabled = False 'switch it off again immediately
If Combo1.Style = 0 Then Combo1.SelStart = 10000: Combo1.SelLength = 0
End Sub
Re: Combobox - Stop (eliminate) Highlight of Item Upon Selection
SamOscarBrown:
Thanks found it. Always wondered where they hid it.
One problem however. In Settings only shows the last one attached (showing).
However, in the thread number, (Edit Post > Go Advanced), managed attachment list where I originally attached each one (same name but different size zips), it shows all three(3), with no way to delete the two older ones (same name) uploaded.