Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTListCtrl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTListCtrl

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


Joined: 08 March 2008
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote floydzhang Quote  Post ReplyReply Direct Link To This Post Topic: CXTListCtrl
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 23 June 2008 at 5:43am
Hi,
LVS_SHOWSELALWAYS have to work. How do you set it ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
floydzhang View Drop Down
Groupie
Groupie


Joined: 08 March 2008
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote floydzhang Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
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 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
Back to Top
floydzhang View Drop Down
Groupie
Groupie


Joined: 08 March 2008
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote floydzhang Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 23 June 2008 at 11:24am
No style for that. :(
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.031 seconds.