Jump to content
Xtreme .Net Talk

Visual Studio MFC dialog application. CListCtrl function


Recommended Posts

Guest gsegria
Posted

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

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...