1

当两种情况下编辑字段为空时,如何区分两者?
当用户点击转义时,我假设用户根本不想要新值,当
输入时,我假设用户想要一个空字符串来编辑项目......

4

1 回答 1

1
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?
     }
}
于 2010-08-27T16:33:56.360 回答