Print Page | Close Window

Don't show selected row when control looses focus

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=4900
Printed Date: 17 May 2024 at 7:50pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Don't show selected row when control looses focus
Posted By: mgampi
Subject: Don't show selected row when control looses focus
Date Posted: 28 August 2006 at 10:07am
Hi;
 
how can I setup the control to not show the selected row(s) when the control does not have the focus.
I want the same behaviour as documented by LVS_SHOWSELALWAYS flag in CListCtrl.
 
Thanks in advance
 
Martin



Replies:
Posted By: sserge
Date Posted: 28 August 2006 at 3:59pm
Hi Martin,

It would be better to implement as a custom handler of GetItemMetrics event. There you can check whether a drawn row is selected, and to change its Fore and Background colors:

if (pDrawArgs->pRow->IsSelected())
{
    pItemMetrics->clrForeground = pDrawArgs->pControl->GetPaintManager()->m_clrHighlightText;
    pItemMetrics->clrBackground = pDrawArgs->pControl->GetPaintManager()->m_clrHighlight;
}


--
WBR,
Serge


Posted By: drisch
Date Posted: 30 August 2006 at 1:20pm
Hi Martin,
 
I was wondering this too. I found, somewhat by accident, that the following seems to have the desired result:
 
  pControl->GetPaintManager()->m_clrBtnFace = GetSysColor(COLOR_WINDOW);
  pControl->GetPaintManager()->m_clrBtnText = GetSysColor(COLOR_WINDOWTEXT);



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net