Are disabled Listviews supposed to look like that?

herilane
02-10-2005, 03:36 PM
When I disable a listview, it doesn't look "properly disabled" like other controls normally do. The background gets gray shading in some places, which looks really ugly, but the text stays black. Is that normal behaviour, or am I missing something?

00100b
02-10-2005, 03:41 PM
Apparently so,

Private Sub Command1_Click()

Me.ListView1.Enabled = False

End Sub

Private Sub Form_Load()

Me.ListView1.ListItems.Add , , "Foo"

End Sub

produces the same effect as the one you are experiencing.

Setting FullRowSelect makes it look a little better by making the full line across the ListView grey instead of just the text-extent part of a column entry.

NEOLLE
02-14-2005, 01:02 AM
You can also set the BackColor property to vbButtonFace after disabling it. Looks fine. :D

herilane
02-14-2005, 09:58 AM
Yes, I can do all sorts of manual things to fix it afterwards... The disadvantage is that I will then have to start treating listviews differently from all other controls. I now have a generic procedure that enables/disables a frame and all controls inside it. I'd very much like to keep it generic.

In this case I ended up creating a usercontrol that consists of a listview inside a frame (I needed to fix some other listview annoyances in any case). So now ListviewEx.Enabled enables/disables the frame, and changes the listview's text colour to gray - and the generic procedure is still generic.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum