响应两个消息 NM_SETFOCUS,NM_KILLFOCUS
void CDatabaseParseDlg::OnNMKillfocusListGroup(NMHDR *pNMHDR, LRESULT *pResult) { // TODO: Add your control notification handler code here m_nGroupSel = m_listGroup.GetSelectionMark(); m_listGroup.SetItemState(m_nGroupSel, LVIS_DROPHILITED, LVIS_DROPHILITED); *pResult = 0; } void CDatabaseParseDlg::OnNMSetfocusListGroup(NMHDR *pNMHDR, LRESULT *pResult) { // TODO: Add your control notification handler code here m_listGroup.SetItemState(m_nGroupSel, FALSE, LVIF_STATE); *pResult = 0; }
LVIS_DROPHILITED 作为一个拖放选项高亮显示
m_listGroup.SetItemState(m_nGroupSel, FALSE, LVIF_STATE);FALSE表示值,
LVIF_STATE表示修改哪一位
时间: 2024-10-06 16:32:45