Solved

Border around CListCtrl object?

Posted on 1998-11-21
3
1,567 Views
Last Modified: 2013-11-20
If I add a List Control to my dialog app using the dialog editor, it has a beveled edge around it so the list appears to be sunken in.  When I create a CListCtrl object manually (not with the dialog editor), it just has a thin black border around it.  How can I get the same type of border?
0
Comment
Question by:duncan2
3 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 50 total points
ID: 1325114
Turn off WS_BORDER in the window style. Turn on WS_EX_CLIENTEDGE instead.

  listCtrl->ModifyStyle(WS_BORDER, 0);
  listCtrl->ModifyStyleEx(0, WS_EX_CLIENTEDGE);


0
 
LVL 2

Expert Comment

by:wyy_cq
ID: 1325115
LONG SetWindowLong( HWND hWnd, // handle of window
                    int nIndex,  // offset of value to set
                    LONG dwNewLong )// new value
or CWindow::SetWindowLong(...)
can help you.

set the parameter of nIndex = GWL_EXSTYLE or =GWL_STYLE.
and set the parameter of dwNewLong to the new style .

before you set the new style , you need to get the old style and add to new style flag to it with "OR" .
GetWindowLong(...,GWL_EXSTYLE,...)
GetWindowLong(...,GWL_STYLE,...) can get the current style of the window.
0
 

Author Comment

by:duncan2
ID: 1325116
The WS_EX_CLIENTEDGE style almost works.  When the dialog first appears, the list control has no edge at all.  Then if I adjust the width of the headers, suddenly the edge changes and looks good.  Any more ideas?

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Get filename and folder into excel 7 79
Separate files macro - Errors on larger data set 18 73
Message not shown 5 67
Problem to App 4 97
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question