|
-
January 17th, 2016, 01:52 AM
#24
Re: select item from listbox and diplay into editbox in mfc vc++
 Originally Posted by [email protected]
Yes it is store into szBuffer but it contain some hex value also. like (0x012200,"text" ) i want just text to store into my variable how to do this?
I got the solution using following code means I got the text of selected value.
void Cselect_product::OnItemchangedListCategory(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
CListCtrl* pListCtrl = (CListCtrl *) GetDlgItem(IDC_ListCategory);
POSITION pos = m_klist.GetFirstSelectedItemPosition ();
if (pos == NULL)
TRACE0 ("No items were selected! \n");
else
{
while (pos)
{
int nItem = m_klist.GetNextSelectedItem (pos);
TRACE1 ("Item %d was selected! \n", nItem);
//you could do your own processing on nItem here
strText = m_klist.GetItemText(nItem, 0);
}
}
*pResult = 0;
}
but list control's view property is set to the List at that time I want all this operation when view property of list control is Report.
Last edited by [email protected]; January 17th, 2016 at 01:57 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|