?
Solved

Border around CListCtrl object?

Posted on 1998-11-21
3
Medium Priority
?
1,697 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 150 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

752 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