First, set the view attribute of list control to report, and add the variable name m_list for list control (this can be used by yourself ).
Then fill in the list control settings in the initialization function of the dialog box as follows:
Bool coiltype: oninitdialog ()
{
M_list.modifystyle (0, lvs_report | lvs_singlesel | lvs_showselalways );
M_list.setextendedstyle (lvs_ex_fullrowselect | lvs_ex_gridlines | lvs_ex_headerdragdrop );
M_list.settextcolor (RGB (, 0, 0); // display the font color
DWORD dwstyle = m_list.getstyle ();
Dwstyle | = lvs_ex_gridlines | lvs_ex_fullrowselect | lvs_showselalways;
M_list.setextendedstyle (dwstyle );
M_list.setbkcolor (RGB (240,247,233); // select the color of this column
M_list.settextbkcolor (RGB (240,247,233 ));
M_list.insertcolumn (0, "date", lvcfmt_center, 80, 0 );
M_list.insertcolumn (1, "oil number", lvcfmt_center );
M_list.insertcolumn (2, "oil unit price", lvcfmt_center );
M_list.insertcolumn (3, "Oil Depot No.", lvcfmt_center );
M_list.insertcolumn (4, "inventory", lvcfmt_center, 60, 4 );
......................
Return true
}