From:
http://www.codeproject.com/listctrl/headerctrlex.asp
Code list:
MlhlistCtrl.cpp, mlhlistctrl.h, headerctrlex.cpp, headerctrlex.h
Applicable environment: VC6, VC.NET is displayed in the dialog (the original article has provided examples in MDI)
usage:
0. Solutions / Add / Add Existing Items / Add CPP, H, HEADERCTRLEX and MLHLISTCTRL
1. At the beginning of the DLG of the DLG where the ListCtrl in which multi-wire title is to be used #include "mlhlistctrl.h"
2. Find clistctrl m_lvwxxx in DLG.H; replace it into cmlhlistctrl m_lvwxxx; // above M_LVWXXX is the variable corresponding to the control
3. Find the clickitDialog () in the corresponding dlg.cpp to replace the code with the following code CStringArray Columnhead; ColumnHeader.Add ("/ ncol1 / nln1 / n"); colornheader.add ("/ NCOL2 / NLN1 / N"); ColumnHeader.Add ("/ ncol3 / nln1 / n"); int coLWIDTH [] = {60, 200, 100}; m_lvwxxx.initcontrolheadings (ColumnHeader, ColWidth);
Note: The 3-line title is shown here (the first line is used to '/ n'). Adjust the height of the title bar in CmlhlistCtrl :: InitControlheadings (...) M_CFontnewHeaderfont.createPointFont (190, "MS Serif"); Adjustment Number 190 (two lines) Adapt to multi-line