The grid controls are very versatile and need to implement an Excel-like interface in one of my projects, so I've adopted a good Cgridctrl control whose original author is Chris Maunder (the latest version of the MFC Grid control written by the original author can go to http:/ /www.codetools.com/miscctrl/gridctrl.asp lookup) To facilitate the merging and revocation of cells, I have customized several public member functions as follows
Setcellcombine (); Set the merge properties of a cell
Undocellcombine (); Cancel Merge
Setfixedcellcombine (); Merging cells
GETCELLP (); Get the Cell object pointer
Its specific implementation I added//want remove it in the code? And the//added for combine comment statement to indicate that the code in this description is for merging. To facilitate later changes.
Method of Use:
The file name is: gridctr.cpp,gridctr.p,cellrange.h,griddroptarget.cpp,griddroptarget.h
Inplaceedit.cpp,inplaceedit.h, Inplacelist.cpp,inplacelist.h, Memdc.h,titletip.cpp, TitleTip.h copied into your project and then imported. It's OK to modify the corresponding header file.
This article provides sample code that contains all the source programs, and the sample program runs as follows: