Print Page | Close Window

CXTListCtrl

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=11148
Printed Date: 16 June 2025 at 1:06pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTListCtrl
Posted By: floydzhang
Subject: CXTListCtrl
Date Posted: 23 June 2008 at 3:33am

Hi, friends

I meet a problem. When the listctrl loses focus, fox example, I click the buttons, click other panes, how the selection in listctrl can keep sitll hlighted?
 
I set the style of listctrl with LVS_SHOWSELALWAYS, but it didn't work.
 
Regards
Floyd



Replies:
Posted By: Oleg
Date Posted: 23 June 2008 at 5:43am
Hi,
LVS_SHOWSELALWAYS have to work. How do you set it ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: floydzhang
Date Posted: 23 June 2008 at 6:03am
Hi,
 
I put the code like this in the OnInitialUpdate().
 
CFormView::OnInitialUpdate();

SetScaleToFitSize(CSize(0));
ModifyStyle(0, /*WS_CLIPCHILDREN|*/ WS_CLIPSIBLINGS);
ModifyStyleEx(WS_EX_CLIENTEDGE, WS_EX_STATICEDGE, SWP_FRAMECHANGED);

m_btnNGTypeExpand.SetBrowseStyle(BES_XT_POPUPMENU);
m_btnNGTypeExpand.Initialize(&m_txtNGType, BES_XT_POPUPMENU, IDR_NGTYPE_POPUP, 0);

 //m_arrButton[0].SetShade(CShadeButtonST::SHS_HARDBUMP);
 //m_arrButton[1].SetShade(CShadeButtonST::SHS_HARDBUMP);
 //m_arrButton[2].SetShade(CShadeButtonST::SHS_HARDBUMP);
 //m_arrButton[3].SetShade(CShadeButtonST::SHS_HARDBUMP);

 m_listCtrl.DeleteAllItems();
 while (m_listCtrl.DeleteColumn(0));

 // Insert the columns.
 m_listCtrl.InsertColumn(0, _T("Task"), LVCFMT_LEFT, 125);
 m_listCtrl.InsertColumn(1, _T("Status"), LVCFMT_LEFT, 125);

 ListView_SetExtendedListViewStyle(m_listCtrl.m_hWnd,
           LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT | LVS_SHOWSELALWAYS);

But it din't work, when I click the button located on the same formview, the highlight was cleared.


Posted By: mgampi
Date Posted: 23 June 2008 at 6:12am
Hi;
LVS_SHOWSELALWAYS is not an extended listview style. Try to set the style in your dialog ressource.


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: floydzhang
Date Posted: 23 June 2008 at 6:45am
Hi,
 
Thank you. It works but it still doesn't meet my requirement. When the listctrl lost focus, the highlight became light gray, but I want the highlight color keeps the same, blue. Meanwhile, the listctrl will lose hightlight when I click blank part of the listctrl, this is what I don't want as well. Any idea? I have to derive a class from listctrl?
 
Regards
Boyang


Posted By: Oleg
Date Posted: 23 June 2008 at 11:24am
No style for that. :(

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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