• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

Setting Views in List View

Can I have the full source code to change to different Views for a list view...

my implementation of :


      DWORD dwNewStyle = LVS_SMALLICON;
      DWORD dwOldStyle = GetWindowLong(m_hWnd, GWL_STYLE);
      dwNewStyle |= (dwOldStyle &=~LVS_TYPEMASK);
      SetWindowLong(m_hWnd, GWL_STYLE, dwNewStyle);

doesnt seem to do anything. I insert this codes to a bunch of buttons which represent the different views. I change the variable dwNewStyle to support the 4 views.

Thanks..
0
load_o_crap
Asked:
load_o_crap
1 Solution
 
ZoppoCommented:
Hi load_o_crap,

Just use CWnd::ModifyStyle() to change it, i.e.:

CWnd* pList = GetDlgItem( IDC_LIST1 );
// change to SmallIcon view
pList->ModifyStyle( LVS_TYPEMASK, LVS_SMALLICON );


hope that helps,

ZOPPO
0
 
load_o_crapAuthor Commented:
cool!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now