Solved

Border around CListCtrl object?

Posted on 1998-11-21
3
1,597 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 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Prevent this page from creating additional dialogs. 3 720
lucky13 challenge 11 158
twoTwo  challenge 35 113
sumHeights2  challenge 7 131
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 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