Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am developing an MFC application which uses CListView control. It is basically a viewer which will read a binary file and display the info read as records. Now I have to implement a feature like goto record number. I dont have any pointers to that. Can you guys hint me on this.

Thanks in advance.
Posted

myListCtrl.SetItemState(idx, LVIS_SELECTED, LVIS_SELECTED)
 
Share this answer
 
WritePrivateProfileString can used to store
below function is used to retrive the corresponding item selected in the list control
void CSDINew2View::OnListSelectionChanged(NMHDR * pNotifyStruct, LRESULT * result)
{
	WCHAR m_VStrBuf[256];
	m_VListId = m_CListCtrl.GetHotItem();
	GetPrivateProfileString(_T("List1"),m_CListCtrl.GetItemText(m_VListId,NULL),NULL,m_VStrBuf,256,m_VFileName);
	m_CEdit.SetWindowText(m_VStrBuf);
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900