ok here is what I have. I am opening up fields from a database and displaying them inside of a listctrl. Now when I select of the fields and make changes to that field, in the database, I want the changes to show up in the listctrl. Now what I am doing to do that is just reopen the database to show the changes. Now I want the field that I chose in the listctrl to be in view. I can't seem to get that to work. Here is the code that I am using.
int nIndex = nIndex = m_database.GetTopIndex();
m_database.SetItemState(nIndex, LVIS_SELECTED, LVIS_SELECTED);
m_database is my Meber Variable for my listctrl. Those functions are called when I press a button. Now when it runs the first time it works but when I do it again it selects a field that is 3 fields above the one that I want selected. Sometimes it doesn't even work the first time. Is this a VC error or is it something that I am doing wrong.