Click to See Complete Forum and Search --> : NOVICE: List Control selecting a row...


Braulio
June 16th, 1999, 03:49 AM
Hi,

I have a list control, and I have an option to refresh the datas on it ( delete all and put new datas), but I would like to keep on select the text row that was selected in the list control before.

I have tried to do this ( in a loop..., while I'm inserting...):

if (iOldSelected!=-1 && IEAdr == OldAdrSelected) {
m_lcImportantIE.SetItemState(iIndex,LVIF_STATE,LVIS_FOCUSED|LVIS_SELECTED);
iOldSelected = -1;
}

But don't works, anybody can help me ?, Thanks, Bye !
Braulio

ric
June 16th, 1999, 04:04 AM
Why don't you finish the loop and then select whatever you want.

Braulio
June 16th, 1999, 04:25 AM
I have putted this, and now works:

m_lcImportantIE.SetItemState(iIndex,LVIS_FOCUSED|LVIS_SELECTED,
LVIS_FOCUSED|LVIS_SELECTED);


Is better to do it while I'm inserting the items, because then I only made one loop not too ( to find the text in the row...).

Bye !
Braulio