Simply reload the list view and filter only the rows you want to add
to it. There is no way to hide it otherwise unles you want to spend
days writing an additional project just to hide a row.
Yes, I suppose you could do it by changing the text/foreground color of that
item to simply be the background color (white). The problem there is that if
this item were to be selected, you would then see the white text on the
default blue selection background.
Another thought - You could paint on the text using a brush with a
transparency of 0 rather than the default of 255, e.g.,
Dim InvisibleBrush as Brush = New SolidBrush(Color.FromArgb(0,0,0,0))
Both of these schemes would require you to use the MeasureItem and DrawItem
events.
I didn't think it so complecated... Even WinAPI
SendMessage( hWnd, LB_SETITEMHEIGHT, rowIndex, 0)
doesn't help here...
So, the simplest way is to reload DataSource
Evgeny
Stoitcho Goutsev (100) said:
Hi Don,
Both methods even if implemented ok will leave a blank row on the list box.
I wouldn't call this hiding.
--
B\rgds
100 [C# MVP]
Don Peters said:
Yes, I suppose you could do it by changing the text/foreground color of that
item to simply be the background color (white). The problem there is
if
this item were to be selected, you would then see the white text on the
default blue selection background.
Another thought - You could paint on the text using a brush with a
transparency of 0 rather than the default of 255, e.g.,
Dim InvisibleBrush as Brush = New SolidBrush(Color.FromArgb(0,0,0,0))
Both of these schemes would require you to use the MeasureItem and DrawItem
events.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.