Edit Subitems In Owner Drawn List
-
I cant use SetItemText() for an owner drawn list control. I try using HWND hWnd1 = ::GetDlgItem (m_hWnd,IDC_LIST_1095C); LVITEM lvi; lvi.iSubItem = 3; lvi.pszText = (LPTSTR) "123"; ::SendMessage(hWnd1, LVM_SETITEMTEXT, 0, (LPARAM)&lvi); But it doesnt update the text in the list. Im missing something and I cant figure out what Im missing. Please any response any one can give me will be greatly appreciated.
-
I cant use SetItemText() for an owner drawn list control. I try using HWND hWnd1 = ::GetDlgItem (m_hWnd,IDC_LIST_1095C); LVITEM lvi; lvi.iSubItem = 3; lvi.pszText = (LPTSTR) "123"; ::SendMessage(hWnd1, LVM_SETITEMTEXT, 0, (LPARAM)&lvi); But it doesnt update the text in the list. Im missing something and I cant figure out what Im missing. Please any response any one can give me will be greatly appreciated.
-
I cant use SetItemText() for an owner drawn list control. I try using HWND hWnd1 = ::GetDlgItem (m_hWnd,IDC_LIST_1095C); LVITEM lvi; lvi.iSubItem = 3; lvi.pszText = (LPTSTR) "123"; ::SendMessage(hWnd1, LVM_SETITEMTEXT, 0, (LPARAM)&lvi); But it doesnt update the text in the list. Im missing something and I cant figure out what Im missing. Please any response any one can give me will be greatly appreciated.
Have you checked the handle hWnd1 in the debugger since you have done zero error checking before you dispatch the message to it? Next you haven't zero lvi half it's fields will have rubbish in them, well at least in release mode. Is the subitem index right, don't forget it is a one-based index ? Finally try calling an update after the message to force a redraw, I can't tell if it's needed or not because this is owner draw and depends what you have done.
In vino veritas
-
It's owner draw ... have you hooked the draw messages you are supposed to. We can't see what you are doing or not doing in the draw parts which are your responsibility.
In vino veritas
-
I cant use SetItemText() for an owner drawn list control. I try using HWND hWnd1 = ::GetDlgItem (m_hWnd,IDC_LIST_1095C); LVITEM lvi; lvi.iSubItem = 3; lvi.pszText = (LPTSTR) "123"; ::SendMessage(hWnd1, LVM_SETITEMTEXT, 0, (LPARAM)&lvi); But it doesnt update the text in the list. Im missing something and I cant figure out what Im missing. Please any response any one can give me will be greatly appreciated.
You must be desperate, seeing that you reverted to the SDK! Been there too, more than once! Did you set the item(s) specifically as 'Owner Draw' in the Resource Editor! If you did not, all the above quoted messages will end up in the 'Bit and Byte Bin', in the nearest toilet! Hope this is helpful, :)
Bram van Kampen