Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListView

Status
Not open for further replies.

caconner

Technical User
May 20, 2002
42
US
I have a simple, but annoying dilemma.

Is there a way to get rid of the blue box that surrounds a listview item after it's been clicked? I'm filling a flexgrid based on the itemclick event for the listview. Once I fill the grid, I don't want the listview item to be highlighted. I tried using drophighlight, to no avail.

Thanks in advance!
Cathy
 
Give this a try

Private Sub List1_Click()

If List1.SelCount Then
List1.Selected(List1.ListIndex) = False
End If
End Sub

You will get a flash of the blue box, is that ok? Hope this helps. [spin] If you choose to battle wits with the witless be prepared to lose.
[machinegun][hammer]
 
Unfortunately I'm using a listview, not a listbox, which doesn't support those particular properties. Ater spending an inordinate amount of time finding and adding icons to it, I'm not quite ready to let go yet.

But thanks anyway!
 
I think I may be stuck w/ the blue highlight. The SelectedItem = Nothing isn't killing it either.

The DropHighlight was getting rid of it, but I kept getting error messages. Set up some code based upon using it w/ a nonexistent drag/drop to eliminate the error message, but then it wasn't droppong the highlight. The dropped blue may have only occurred because of the error.

Also tried to set focus somewhere else, since as soon as I click on anything else it goes away. Doesn't like that either.

Thanks for the offer!
Cathy
 
Ooppss... I lied.

I tried Set ListView1.SelectedItem = Nothing under the LostFocus event instead of the ItemClick event out of sheer frustration and it works!! How stupid am I? Especially since I tried the exact same code already at the end of my ItemClick code before I ever posted this thread!!!

Thanks for the mental stimulation/jump start!!!

Cathy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top