当编辑字段在两种情况下都是空的时,我如何区分两者?
当用户点击退出时,我假设用户根本不想要新值,当
输入被击中,我假设用户想要一个空字符串用于编辑的项目...
最佳答案
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?
}
}
关于c++ - 在 CListCtrl 中点击 Escape 与 Enter 触发 LVN_ENDLABELEDIT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3389613/