Are disabled Listviews supposed to look like that?

02-10-2005, 02: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?

02-10-2005, 02: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.

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

02-14-2005, 08: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