Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Don't show selected row when control looses focus
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Don't show selected row when control looses focus

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: Don't show selected row when control looses focus
    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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
drisch View Drop Down
Groupie
Groupie


Joined: 06 July 2006
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote drisch Quote  Post ReplyReply Direct Link To This Post 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);
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.172 seconds.