Chris Maunder 開發的 CGridCtrl 功能強大,支援虛模式、單元格編輯、拖放、標題提示等,適合實現類 Excel 介面。最新版本可至 CodeTools 下載。
將下列檔案複製至專案並加入:
GridCtrl.cpp/h, CellRange.h, GridDropTarget.cpp/h,
InPlaceEdit.cpp/h, InPlaceList.cpp/h, MemDC.h,
TitleTip.cpp/h
為方便合併與取消合併,作者擴充四個公用函式:
SetCellCombine():設定合併屬性UndoCellCombine():取消合併SetFixedCellCombine():合併固定列/欄GetCellp():取得單元格物件指標原始碼中以 //want remove it? 與 //added for combine; 註釋標記修改處,便於維護。
範例展示跨列跨欄合併、編輯、捲動等功能,程式碼結構清晰,可直接應用於報表、試算表類專案。