BOOL CListDlg: : OnInitDialog ()
{
CDialog: : OnInitDialog ();
//TODO: add additional initialization here
M_listCtrl2. SetExtendedStyle (LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
//m_listCtrl2 SetBkColor (RGB (0, 0, 0));
M_listCtrl2. SetTextBkColor (RGB (255, 255, 255));//set the text background color
M_listCtrl2. SetTextColor (RGB (10, 10, 80));//set the text color
M_listCtrl2. DeleteAllItems ();//to empty
M_listCtrl2. InsertColumn (0, "number", LVCFMT_LEFT, 50);//add columns
M_listCtrl2. InsertColumn (1, "type", LVCFMT_LEFT, 45);
M_listCtrl2. InsertColumn (2, "value" CAD, LVCFMT_LEFT, 50);
M_listCtrl2. InsertColumn (3, "measured", LVCFMT_LEFT, 50);
M_listCtrl2. InsertColumn (4, "tolerance", LVCFMT_LEFT, 60).
M_listCtrl2. InsertColumn (5, "tolerance", LVCFMT_LEFT, 60).
M_listCtrl2. InsertColumn (6, "deviation", LVCFMT_LEFT, 60).
M_listCtrl2. InsertColumn (7, "state", LVCFMT_LEFT, 55).
M_listCtrl2. SetRedraw (FALSE);//prevent redraw
The UpdateData (FALSE);
M_nItem=0;
Return TRUE;//return TRUE unless you set the focus to a control
//exception: OCX property page should return FALSE
}
CodePudding user response:
M_ListCtrl. SetExtendedStyle (LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP);His look at the STYLE
CodePudding user response: