CListCtrl::EditLabel CEdit* EditLabel( int nItem );Return ValueIf successful, a pointer to the CEdit object that is used to edit the item text; otherwise NULL.ParametersnItemIndex of the list view item that is to be edited.ResA list view control that has the LVS_EDITLABELS window style enables a user to edit item labels in place. The user begins editing by clicking the label of an item that has the focus.Use this function to begin in-place editing of the specified list view item’s text.Example// The pointer to my list view control. extern CListCtrl* pmyListCtrl;// Make sure the focus is set to the list view control. pmyListCtrl->SetFocus();// Show the edit control on the label of the first // item in the list view control. CEdit* pmyEdit = pmyListCtrl->EditLabel(1); ASSERT(pmyEdit != NULL);CListCtrl Overview | Class Members | Hierarchy ChartSee Also CListCtrl::GetEditControl
CEdit* EditLabel( int nItem );Return ValueIf successful, a pointer to the CEdit object that is used to edit the item text; otherwise NULL.ParametersnItemIndex of the list view item that is to be edited.ResA list view control that has the LVS_EDITLABELS window style enables a user to edit item labels in place. The user begins editing by clicking the label of an item that has the focus.Use this function to begin in-place editing of the specified list view item’s text.Example// The pointer to my list view control.
extern CListCtrl* pmyListCtrl;// Make sure the focus is set to the list view control.
pmyListCtrl->SetFocus();// Show the edit control on the label of the first
// item in the list view control.
CEdit* pmyEdit = pmyListCtrl->EditLabel(1);
ASSERT(pmyEdit != NULL);CListCtrl Overview | Class Members | Hierarchy ChartSee Also CListCtrl::GetEditControl
变通的做法是当点击CListCtrl时,计算鼠标落在哪一格,然后在该格位置上显示一个同样大小的文本框,在文本框中输入数据后,如果按回车,则隐藏文本框,同时将文本框中的内容放到该格中,这样就达到了编辑功能的效果。