Visual Studio MFC dialog application. CListCtrl function

  • Thread starter Thread starter gsegria
  • Start date Start date
G

gsegria

Guest
I created a dialog application in Visual Studio MFC.

I use CListCtrl to list some date. (Item and Content)

I don't change any code in CListCtrl's cpp and h files but CListCtrl color was from gray to white.



1) No change any code , I don't understand why CListCtrl color from gray to white?

2) Any way to change CListCtrl color from white to gary?


void XXX::Init()
{
LONG lStyle;
lStyle = GetWindowLong(this->m_lst1.m_hWnd, GWL_STYLE);
lStyle |= LVS_REPORT;
SetWindowLong(this->m_lst1.m_hWnd, GWL_STYLE, lStyle);
DWORD dwStyle = this->m_lst1.GetExtendedStyle();
dwStyle |= LVS_EX_FULLROWSELECT;
dwStyle |= LVS_EX_GRIDLINES;
this->m_lst1.SetExtendedStyle(dwStyle);

this->m_lst1.DeleteAllItems();
this->m_lst1.InsertColumn(0, _T("Item"), LVCFMT_CENTER, 100);
this->m_lst1.InsertColumn(1, _T("Content"), LVCFMT_CENTER, 160);

this->m_lst1.SetExtendedStyle(this->m_lst1.GetExtendedStyle() | LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
}


1615527.png

Continue reading...
 
Back
Top