문제

how can I differentiate between the two, when the edit field is empty in both cases?
when the user hits escape, I assume user doesn't want the new value at all, when
enter is hit, I assume the user wants an empty string for the edited item...

도움이 되었습니까?

해결책

BEGIN_MESSAGE_MAP(CMyPropertyPage, CPropertyPage)
//{{AFX_MSG_MAP(CMyPropertyPage)
    ON_NOTIFY(LVN_ENDLABELEDIT, IDC_LIST_CONTROL, OnEndLabelEdit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

void CMyPropertyPage::OnEndLabelEdit(NMHDR* pNMHDR, LRESULT* pResult) 
{
    LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;
    if (pDispInfo->item.pszText == NULL)
    {
             //Used clicked escape
     }
     else
     {
            //Data was accepted by user, empty string perhaps?
     }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top