
Checkmark in Dropdown List Style Combobox
Check out the second link Ken sent you.
You could, with a ListView for the drop-down, use an
ImageList control with the ListView (a checkbox Image)
and toggle the image on/off as you see fit.
Also, you can programmatically keep the
user from checking a checkbox.
In ListView:
---------------
Private Sub ListView1_ItemCheck(ByVal Item As MSComctlLib.ListItem)
If Item.Checked Then Item.Checked = False
End Sub
In ListBox:
---------------
Private Sub List1_KeyPress(KeyAscii As Integer)
With List1
If .Selected(.ListIndex) Then
.Selected(.ListIndex) = False
End If
End With
End Sub
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
With List1
If .Selected(.ListIndex) Then
.Selected(.ListIndex) = False
End If
End With
End Sub
Quote:
> > Here are a couple things that may help...
> > Substituting a Tabbed ListBox for a Combo's Dropdown List
> > http://www.mvps.org/vbnet/index.html?code/subclass/combotabbedlist.htm
> Thanks for that link. I had checked that site before
> posting my question, but didn't see that that article would
> help much. After looking at it more in depth, I see that it
> gets me a little closer to what I want.
> Following the example in that article, I can substitute a
> tabbed listbox for the dropdown box in a combo. For my
> purposes, I would like to use tabs. Unfortunately, getting
> a checkmark is more important to me. Right now I'm using
> the letter "x" to indicate items that should be checked. I
> could use a checked listbox, but I don't want the
> checkmarks to be directly editable by the user. If I could
> change fonts, I could get the checkmark from Wingdings.
> Unfortunately, I can't do that.
> So, any other suggestions about getting a checkmark in a
> dropdown combo would be appreciated.
> Thanks again,
> Greg
> ----
> greg -at- spencersoft -dot- com