Click here to Skip to main content
15,891,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CStatic WS_VISIBLE how to repaint ? (newbies) Pin
27-Jun-01 17:38
suss27-Jun-01 17:38 
GeneralRe: CStatic WS_VISIBLE how to repaint ? (newbies) Pin
28-Jun-01 9:32
suss28-Jun-01 9:32 
GeneralUsing a template to copy data Pin
27-Jun-01 10:49
suss27-Jun-01 10:49 
GeneralRe: Using a template to copy data Pin
Tomasz Sowinski27-Jun-01 10:55
Tomasz Sowinski27-Jun-01 10:55 
GeneralRe: Using a template to copy data Pin
27-Jun-01 11:10
suss27-Jun-01 11:10 
GeneralRe: Using a template to copy data Pin
Tomasz Sowinski27-Jun-01 11:16
Tomasz Sowinski27-Jun-01 11:16 
GeneralRe: Using a template to copy data Pin
27-Jun-01 11:25
suss27-Jun-01 11:25 
QuestionHow does CListCtrl manage its scrollbars? Pin
Michael Carruth27-Jun-01 10:43
Michael Carruth27-Jun-01 10:43 
I'm working on an application that contains a CListCtrl. One requirement for the list is that it always displays its vertical and horizontal scrollbars, regardless of the client area. I've tried simply setting the WS_HSCROLL and WS_VSCROLL styles during creation, but to no avail. After much trial and error, I was able to force the scrollbars to display by modifying the list's style in response to a WM_SIZE message.

//
// WM_SIZE handler
//
void ACtrlGrid::OnSize(UINT f_nType, int f_cx, int f_cy)
{
// call base class
CWnd::OnSize(f_nType, f_cx, f_cy);

// re-add horz + vert scrolls
UINT nStyle = GetStyle();
if ( (nStyle & WS_HSCROLL) != WS_HSCROLL
|| (nStyle & WS_VSCROLL) != WS_VSCROLL )
{
ModifyStyle(0, WS_HSCROLL | WS_VSCROLL,
SWP_NOMOVE | SWP_NOSIZE |
SWP_NOZORDER | SWP_FRAMECHANGED);
}
else
{
// ... actually handle WM_SIZE message
}
}

I have two problems with this approach. First, as a result of re-adding the scrollbars the client area size changes which generates another WM_SIZE message. Eventually this recursion is terminated, no thanks to me, but its still a hack. My second issue involves the CListCtrl's header sizing ability. With this approach it is impossible to grab the last column's sizing handle because the vertical scrollbar is covering the right edge of the last column header item. It seems that the listview don't realize when the vertical scrollbar is displayed, and as a result, the horizontal scrollbar range is not increased to account for the extra room the scrollbar is covering.

I'm really looking for an elegant way to override the listview's default scrollbar implementation.

Your assistance is greatly appreciated.

Mike
AnswerRe: How does CListCtrl manage its scrollbars? Pin
27-Jun-01 17:23
suss27-Jun-01 17:23 
QuestionHow to enable/disable a menu item in the system tray Pin
Anubha Khurana27-Jun-01 10:14
Anubha Khurana27-Jun-01 10:14 
AnswerRe: How to enable/disable a menu item in the system tray Pin
Bret Faller27-Jun-01 12:36
Bret Faller27-Jun-01 12:36 
GeneralRe: How to enable/disable a menu item in the system tray Pin
Anubha Khurana27-Jun-01 14:08
Anubha Khurana27-Jun-01 14:08 
QuestionHow to upload a file to a php file that normally handle a html form ?? Pin
27-Jun-01 9:11
suss27-Jun-01 9:11 
AnswerRe: How to upload a file to a php file that normally handle a html form ?? Pin
Tomasz Sowinski27-Jun-01 9:40
Tomasz Sowinski27-Jun-01 9:40 
GeneralMy registry won't register Pin
Joe Moldovan27-Jun-01 9:03
Joe Moldovan27-Jun-01 9:03 
GeneralRe: My registry won't register Pin
Tomasz Sowinski27-Jun-01 9:34
Tomasz Sowinski27-Jun-01 9:34 
GeneralRe: My registry won't register Pin
Joe Moldovan27-Jun-01 12:49
Joe Moldovan27-Jun-01 12:49 
GeneralNew User C++ help Pin
Rob Frymire27-Jun-01 8:58
Rob Frymire27-Jun-01 8:58 
GeneralRe: New User C++ help Pin
Tomasz Sowinski27-Jun-01 9:45
Tomasz Sowinski27-Jun-01 9:45 
GeneralDynamically allocate an array of an array Pin
Zach27-Jun-01 7:16
Zach27-Jun-01 7:16 
GeneralRe: Dynamically allocate an array of an array Pin
Frank Liao27-Jun-01 7:57
Frank Liao27-Jun-01 7:57 
GeneralRe: Dynamically allocate an array of an array Pin
Zach27-Jun-01 8:47
Zach27-Jun-01 8:47 
GeneralRe: Dynamically allocate an array of an array Pin
Frank Liao27-Jun-01 9:26
Frank Liao27-Jun-01 9:26 
GeneralRe: Dynamically allocate an array of an array Pin
Zach27-Jun-01 17:06
Zach27-Jun-01 17:06 
GeneralWindows service basics (start, install...) Pin
Joan M27-Jun-01 6:33
professionalJoan M27-Jun-01 6:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.