Hello, here is something what can be helpful? First you have to catch the OnClick() Event, and save the previous and current selection! This is what works:
CMyDialog::OnClickList(NMHDR* pNMHDR, LRESULT* pResult)
{
// iSelectionCurrent and iSelectionOld are members from my dialog:
iSelectionCurrent = m_cListResults.GetSelectionMark(); // ok, take a current selection!
if(iSelectionOld == -1)
{
// if my old selection is less then 0,
// that means i never select something before,
// ok, then save the current selection for the first time!
iSelectionOld = iSelectionCurrent; // here
}
else
{ // else, i select an item before, so is iSelectionOld >= 0!
m_cListResults.SetCheck(iSelectionOld, FALSE); // ok, lets uncheck the previous selection
iSelectionOld = iSelectionCurrent; // save the current selection!
// this is the same:
// iSelectionOld = m_cListResults.GetSelectionMark();
}
m_cListResults.SetCheck(m_cListResults.GetSelectionMark(), TRUE); // and check the new selected item(Row)
*pResult = 0;
}
regards break; -- modified at 4:54 Thursday 12th October, 2006