Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Border around CListCtrl object?

Posted on 1998-11-21
3
Medium Priority
?
1,764 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

Independent Software Vendors: 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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

618 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