Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Icons bkg color in ReportCtrl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Icons bkg color in ReportCtrl

 Post Reply Post Reply
Author
Message
securigy View Drop Down
Groupie
Groupie


Joined: 23 November 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote securigy Quote  Post ReplyReply Direct Link To This Post Topic: Icons bkg color in ReportCtrl
    Posted: 31 March 2009 at 1:49pm
I have the following code when setting up my report control:
 
// bkg color of the sorted column
pListCtrl->SetSortBackColor(RGB(235,235,235));

// create image list and associate it with the listctrl

CBitmap bitmap;
bitmap.LoadBitmap(IDB_TREE_ICONS);
m_ImageList.Create(16, 16, ILC_COLOR24|ILC_MASK, 6, 1);
m_ImageList.Add(&bitmap, RGB(255,0,255));
m_BtListCtrl.SetImageList(&m_ImageList, LVSIL_SMALL);
the result looks like that:
that is, the bkg color of the icon displayed white instead of grey of RGB(235,235,235)
the bkg color in the resource bitmap is RGB(255,0,255)
 
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2009 at 11:08pm
What is this question about? CListCtrl? or ReportControl? Report Control have no function SetImageList(&m_ImageList, LVSIL_SMALL);
It has function for GetImageManager

//SetImageList(UINT nBitmap, int cx, int nBaseCommand, COLORREF clrMask)

e.g. wndReport.GetImageManager()->SetImageList(IDB_ICONVIEWTEST, 32, 0, RGB(255, 0, 255));


Back to Top
securigy View Drop Down
Groupie
Groupie


Joined: 23 November 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote securigy Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2009 at 12:53pm
sorry. it is my list control class derived from CXTListCtrl class.
Back to Top
securigy View Drop Down
Groupie
Groupie


Joined: 23 November 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote securigy Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2009 at 8:21pm
Rephrasing the question. I have the following code that sets the background of the sorted column in my listctrl that is derived from CXTListCtrl:
 

pListCtrl->EnableUserSortColor(TRUE);

m_nSortedCol = 0;

m_bAscending = TRUE;

pListCtrl->SetSortBackColor(RGB(235,235,235)); // light grey color

SortColumn(m_nSortedCol, m_bAscending);

pListCtrl->RedrawWindow();

Then I have the code that adds image list for the listctrl icons:

// create image list and associate it with the listctrl

CBitmap bitmap;

bitmap.LoadBitmap(IDB_LIST_ICONS);

m_ImageList.Create(16, 16, ILC_COLOR24|ILC_MASK, 6, 1);

m_ImageList.Add(&bitmap, RGB(235,0,235)); // the bitmap resource has grey background

m_BtListCtrl.SetImageList(&m_ImageList, LVSIL_SMALL);

The bottom line is that the icons do not show correctly: there are some 2 white vertical pixels and 1 horizontal... Is it a bug in CXTListCtrl ? or am I doing something wrong here?

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2009 at 12:09am

Check CodeProject - CodeGuru site - they have enough info about CListCtrl and derivations

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.