F
Fritz
I know it, I know it. It's come up a lot. I've done the Googling, but
the standard answer doesn't do what I expect it to. For the record, the
standard answer is: "Set the Selected property of a ListViewItem to
true." I also know from MSDN that the selection won't really take
effect until the ListView has focus.
My specific problem is that setting item.Select = true doesn't actually
select my item (or at least, doesn't highlight it). I'm implementing a
search feature, and the highlighting is kind of important.
Even more curious, Microsoft's own C# code sample at
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/CPref17/html/P_System_Windows_Forms_ListViewItem_Selected.htm
(might need to get there through VS2005 documentation) illustrates my
problem exactly. The first list item does not get selected on list
population, even though the code tells it to do so. Selection seems to
work after a click on the button, but not before.
1) What's so magical about that button click?
2) Is this a bug in the framework?
Spanks
ff
the standard answer doesn't do what I expect it to. For the record, the
standard answer is: "Set the Selected property of a ListViewItem to
true." I also know from MSDN that the selection won't really take
effect until the ListView has focus.
My specific problem is that setting item.Select = true doesn't actually
select my item (or at least, doesn't highlight it). I'm implementing a
search feature, and the highlighting is kind of important.
Even more curious, Microsoft's own C# code sample at
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/CPref17/html/P_System_Windows_Forms_ListViewItem_Selected.htm
(might need to get there through VS2005 documentation) illustrates my
problem exactly. The first list item does not get selected on list
population, even though the code tells it to do so. Selection seems to
work after a click on the button, but not before.
1) What's so magical about that button click?
2) Is this a bug in the framework?
Spanks
ff