|
-
January 15th, 2016, 07:01 AM
#20
Re: select item from listbox and diplay into editbox in mfc vc++
 Originally Posted by 2kaud
Something like (not tried)
Code:
void Cselect_product::OnClickListCategory(NMHDR* pNMHDR, LRESULT* pResult)
{
POSITION p = m_klist.GetFirstSelectedItemPosition();
while (p)
{
int nItemIndex = m_klist.GetNextSelectedItem(p);
TCHAR szBuffer[1024] = {0};
DWORD cchBuf(1023);
LVITEM lvi;
lvi.iItem = nItemIndex;
lvi.iSubItem = 0;
lvi.mask = LVIF_TEXT;
lvi.pszText = szBuffer;
lvi.cchTextMax = cchBuf;
if (m_klist.GetItem(&lvi)) {
//use szBuffer here
} else
OutputDebugString("Error with GetItem\n");
}
*pResult = 0;
}
Where(in which veriable) is text stored of select item in list control ?
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
|