资源简介

在VS平台开发的一个可以双击ListControl单元格进行编辑的代码示例。

资源截图

代码片段和文件信息

// EditItem.cpp : 实现文件
//

#include “stdafx.h“
#include “EnableEditListControl.h“
#include “EditItem.h“


// CEditItem

IMPLEMENT_DYNAMIC(CEditItem CEdit)

CEditItem::CEditItem()
{

}

CEditItem::~CEditItem()
{
}


BEGIN_MESSAGE_MAP(CEditItem CEdit)
END_MESSAGE_MAP()


BOOL CEditItem::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN)
{
if (pMsg->wParam == 13)
{
pMsg->message = WM_KILLFOCUS;
}
else if (pMsg->message == 27)
{
m_bInputValid = FALSE;
pMsg->message = WM_KILLFOCUS;
}
}
return CEdit::PreTranslateMessage(pMsg);
}

void CEditItem::OnKillFocus(CWnd* pNewWnd)
{


}


// CEditItem 消息处理程序

//void CEditItem::OnKillFocus(CWnd* pNewWnd) 
//{
// CEdit::OnKillFocus(pNewWnd);
// CString str; GetWindowText(str);
//
// // 发送消息给父窗口
//
// LV_DISPINFO lvDispInfo;
// lvDispInfo.hdr.hwndFrom = GetParent()->m_hWnd;
// lvDispInfo.hdr.idFrom = GetDlgCtrlID(); 
// lvDispInfo.hdr.code = LVN_ENDLABELEDIT;
// lvDispInfo.item.mask = LVIF_TEXT; 
// lvDispInfo.item.iItem = m_nItem;
// lvDispInfo.item.iSubItem = m_nSubItem;
// lvDispInfo.item.pszText = m_bVK_ESCAPE ? NULL : LPTSTR((LPCTSTR)str);
// lvDispInfo.item.cchTextMax = str.GetLength();
// GetParent()->GetParent()->SendMessage( WM_NOTIFY GetParent()->GetDlgCtrlID()(LPARAM)&lvDispInfo);
// DestroyWindow(); 
//}





 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       5908  2012-05-07 14:16  EnableEditListControl\EnableEditListControl\Debug\BuildLog.htm

     文件      18250  2012-05-07 14:02  EnableEditListControl\EnableEditListControl\Debug\EditItem.obj

     文件      28253  2012-05-07 14:08  EnableEditListControl\EnableEditListControl\Debug\EditListCtrl.obj

     文件       1196  2012-05-07 10:46  EnableEditListControl\EnableEditListControl\Debug\EnableEditListControl.exe.embed.manifest

     文件       1260  2012-05-07 10:46  EnableEditListControl\EnableEditListControl\Debug\EnableEditListControl.exe.embed.manifest.res

     文件        861  2012-05-07 14:16  EnableEditListControl\EnableEditListControl\Debug\EnableEditListControl.exe.intermediate.manifest

     文件      19491  2012-05-07 14:10  EnableEditListControl\EnableEditListControl\Debug\EnableEditListControl.obj

     文件   25296896  2012-05-07 14:02  EnableEditListControl\EnableEditListControl\Debug\EnableEditListControl.pch

     文件      23524  2012-05-07 14:02  EnableEditListControl\EnableEditListControl\Debug\EnableEditListControl.res

     文件      37794  2012-05-07 14:12  EnableEditListControl\EnableEditListControl\Debug\EnableEditListControlDlg.obj

     文件         65  2012-05-07 14:16  EnableEditListControl\EnableEditListControl\Debug\mt.dep

     文件     463931  2012-05-07 14:02  EnableEditListControl\EnableEditListControl\Debug\stdafx.obj

     文件     912384  2012-05-07 14:12  EnableEditListControl\EnableEditListControl\Debug\vc90.idb

     文件    2002944  2012-05-07 14:12  EnableEditListControl\EnableEditListControl\Debug\vc90.pdb

     文件       1411  2012-05-07 10:45  EnableEditListControl\EnableEditListControl\EditItem.cpp

     文件        330  2012-05-07 10:45  EnableEditListControl\EnableEditListControl\EditItem.h

     文件       2726  2012-05-07 14:08  EnableEditListControl\EnableEditListControl\EditListCtrl.cpp

     文件        548  2012-05-07 11:01  EnableEditListControl\EnableEditListControl\EditListCtrl.h

     文件      59000  2012-05-07 13:48  EnableEditListControl\EnableEditListControl\EnableEditListControl.aps

     文件       1842  2012-05-07 10:05  EnableEditListControl\EnableEditListControl\EnableEditListControl.cpp

     文件        531  2012-05-07 10:05  EnableEditListControl\EnableEditListControl\EnableEditListControl.h

     文件       5435  2012-05-07 13:48  EnableEditListControl\EnableEditListControl\EnableEditListControl.rc

     文件       5882  2012-05-07 13:52  EnableEditListControl\EnableEditListControl\EnableEditListControl.vcproj

     文件       1411  2012-05-07 14:16  EnableEditListControl\EnableEditListControl\EnableEditListControl.vcproj.ASUS-PC.ASUS.user

     文件       3875  2012-05-07 14:12  EnableEditListControl\EnableEditListControl\EnableEditListControlDlg.cpp

     文件        788  2012-05-07 14:10  EnableEditListControl\EnableEditListControl\EnableEditListControlDlg.h

     文件       3015  2012-05-07 10:05  EnableEditListControl\EnableEditListControl\ReadMe.txt

    .......     21630  2003-07-24 09:52  EnableEditListControl\EnableEditListControl\res\EnableEditListControl.ico

     文件        377  2012-05-07 10:05  EnableEditListControl\EnableEditListControl\res\EnableEditListControl.rc2

     文件        740  2012-05-07 13:48  EnableEditListControl\EnableEditListControl\resource.h

............此处省略12个文件信息

评论

共有 条评论