资源简介
在listctrl中添加edit控件和combo box控件
vc6编译通过,封装成类便于复用
代码片段和文件信息
/*******************************************************************************
Author : Aravindan Premkumar
Unregistered Copyright 2003 : Aravindan Premkumar
All Rights Reserved
This piece of code does not have any registered copyright and is free to be
used as necessary. The user is free to modify as per the requirements. As a
fellow developer all that I expect and request for is to be given the
credit for intially developing this reusable code by not removing my name as
the author.
*******************************************************************************/
#include “stdafx.h“
#include “ComboListCtrl.h“
#include “InPlaceCombo.h“
#include “InPlaceEdit.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//#defines
#define FIRST_COLUMN 0
#define MIN_COLUMN_WIDTH 10
#define MAX_DROP_DOWN_ITEM_COUNT 10
/////////////////////////////////////////////////////////////////////////////
// CComboListCtrl
CComboListCtrl::CComboListCtrl()
{
m_iColumnCounts = 0;
m_ComboSupportColumnsList.RemoveAll();
m_ReadOnlyColumnsList.RemoveAll();
m_strValidEditCtrlChars.Empty();
m_dwEditCtrlstyle = ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_LEFT | ES_NOHIDESEL;
m_dwDropDownCtrlstyle = WS_BORDER | WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL | ES_AUTOVSCROLL |
CBS_DROPDOWNLIST | CBS_DISABLENOSCROLL;
}
CComboListCtrl::~CComboListCtrl()
{
CInPlaceCombo::DeleteInstance();
CInPlaceEdit::DeleteInstance();
}
BEGIN_MESSAGE_MAP(CComboListCtrl CListCtrl)
//{{AFX_MSG_MAP(CComboListCtrl)
ON_WM_HSCROLL()
ON_WM_VSCROLL()
ON_WM_LBUTTONDOWN()
ON_NOTIFY_REFLECT(LVN_ENDLABELEDIT OnEndLabelEdit)
ON_NOTIFY_REFLECT(LVN_BEGINLABELEDIT OnBeginLabelEdit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CComboListCtrl message handlers
CInPlaceCombo* CComboListCtrl::ShowInPlaceList(int iRowIndex int iColumnIndex CStringList& rComboItemsList
CString strCurSelecetion /*= ““*/ int iSel /*= -1*/)
{
// The returned obPointer should not be saved
// Make sure that the item is visible
if (!EnsureVisible(iRowIndex TRUE))
{
return NULL;
}
// Make sure that iColumnIndex is valid
CHeaderCtrl* pHeader = static_cast (GetDlgItem(FIRST_COLUMN));
int iColumnCount = pHeader->GetItemCount();
if (iColumnIndex >= iColumnCount || GetColumnWidth(iColumnIndex) < MIN_COLUMN_WIDTH)
{
return NULL;
}
// Calculate the rectangle specifications for the combo box
CRect obCellRect(0 0 0 0);
CalculateCellRect(iColumnIndex iRowIndex obCellRect);
int iHeight = obCellRect.Height();
int iCount = (int )rComboItemsList.GetCount();
iCount = (iCount < MAX_DROP_DOWN_ITEM_COUNT) ?
iCount + MAX_DROP_DOWN_ITEM_COUNT : (MAX_DROP_DOWN_ITEM_COUNT + 1);
obCellRect.bottom += iHeight * iCount;
// Create the in
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1668 2004-07-15 14:23 TestComboListCtrl\TestComboListCtrlDlg.h
文件 7084 2004-07-15 14:39 TestComboListCtrl\TestComboListCtrlDlg.cpp
文件 5713 2004-07-15 14:37 TestComboListCtrl\TestComboListCtrl.rc
文件 1397 2004-09-06 16:19 TestComboListCtrl\TestComboListCtrl.clw
文件 3777 2004-07-15 14:11 TestComboListCtrl\ReadMe.txt
文件 1445 2004-07-15 14:11 TestComboListCtrl\TestComboListCtrl.h
文件 2217 2004-07-15 14:11 TestComboListCtrl\TestComboListCtrl.cpp
文件 4765 2004-07-15 14:39 TestComboListCtrl\TestComboListCtrl.dsp
文件 1054 2004-07-15 14:11 TestComboListCtrl\StdAfx.h
文件 219 2004-07-15 14:11 TestComboListCtrl\StdAfx.cpp
文件 409 2004-07-15 14:11 TestComboListCtrl\res\TestComboListCtrl.rc2
文件 1078 2004-07-15 14:11 TestComboListCtrl\res\TestComboListCtrl.ico
目录 0 2004-07-15 14:11 TestComboListCtrl\res
文件 557 2004-07-15 14:11 TestComboListCtrl\TestComboListCtrl.dsw
文件 4487 2003-12-24 16:11 TestComboListCtrl\InPlaceCombo.cpp
文件 2853 2003-12-24 16:11 TestComboListCtrl\InPlaceCombo.h
文件 5024 2004-07-14 09:26 TestComboListCtrl\InPlaceEdit.cpp
文件 2819 2004-07-14 09:27 TestComboListCtrl\InPlaceEdit.h
文件 12216 2004-07-14 17:11 TestComboListCtrl\ComboListCtrl.cpp
文件 5002 2004-07-14 17:06 TestComboListCtrl\ComboListCtrl.h
文件 268 2004-09-06 16:04 TestComboListCtrl\TestComboListCtrl.plg
文件 787 2004-07-15 14:22 TestComboListCtrl\Resource.h
文件 66560 2004-09-06 16:19 TestComboListCtrl\TestComboListCtrl.ncb
目录 0 2004-09-06 15:00 TestComboListCtrl\Debug
文件 21280 2004-09-06 15:02 TestComboListCtrl\TestComboListCtrl.aps
文件 113664 2004-09-06 16:19 TestComboListCtrl\TestComboListCtrl.opt
目录 0 2004-07-15 14:11 TestComboListCtrl
----------- --------- ---------- ----- ----
266343 27
............此处省略0个文件信息
相关资源
- Beginning C++17 5th Edition.pdf56911
- 自绘CListCtrl聊天列表MFC
- VC++中实现复选下拉框CCheckComboBox
- Data Structures and Algorithm Analysis in C++
- Effective C++ 中文版2nd Edition
- C How to Program 7th Edition
- C++ Concurrency in Action 2nd Edition (2019.
- C++ Concurrency in Action- 2nd Edition(英文第
- C++ Primer(5th)2017Edition 无水印pdf
- Managing Projects with GNU Make 3rd edition 英
- C++ Concurrency in Action 2nd edition235206
- Data Structures and Algorithm Analysis in C++ (
- Cimco Edit v4.40.07 破解版
- 数值分析(Numerical Recipes)3rd Edition原
- Sams Teach Yourself C++ in One Hour a Day (8
- listctrl加入BUTTON复选框,编辑框,调整
- MFC richedit可进行插入图片、表情,有
- Effective C++ Third Edition 英文 第3版 PDF
- MFC透明Edit
- Problem Solving with C++ 10th Global Edition
- The Nurbs book (2nd.Edition)
- 免费:C++ Primer Plus 6th Edition英文版p
- c++ concurrency in action 2nd edition
- 基于Scintilla开发的MFC多文档源代码编
- Boost.Asio C++ Network Programming 2nd edition
- GoF+23种设计模式解析(2nd+Edition).p
- ultraedit 各种语法高亮着色官方文档比
- C++.How.to.Program8th.Edition 答案源代码
- mfc按CEdit编辑框弹出自定义键盘
- VC6.0将ListCtrl中数据写入到Excel
评论
共有 条评论