May 7th, 2002, 09:11 AM
SOLUTION: How to hide the scrollbars on CListCtrl without loosing the functonality to scroll :)
m_pl = CListCtrl!!!
int cxvs, cyvs;
cxvs = GetSystemMetrics (SM_CXVSCROLL);
cyvs = GetSystemMetrics (SM_CYVSCROLL);
m_pl.SetWindowPos (0, ierect.left, ierect.top, ierect.right+cxvs, ierect.bottom+cyvs, SWP_NOMOVE | SWP_NOZORDER);
ierect.bottom -= ierect.top+cyvs;
//ierect.bottom -= (ierect.top-ierect.bottom);
ierect.right -= ierect.left;
ierect.top = 0;
ierect.left = 0;
HRGN iehrgn = CreateRectRgn (ierect.left, ierect.top, ierect.right-2, ierect.bottom);
m_pl.SetWindowRgn (iehrgn, false);
There are some trial and error to get it nice into your code, but I think it is a great solution to make a CListCtrl blend into the backround and make your own scrollbars (if needed )
ListCtrl is good, but it just got better!
Regards Large , aka Lars.
Visit me at: http://lars.werner.no/
June 24th, 2003, 06:59 PM
Great Code! This helps me a lot!
Last edited by revg75; July 1st, 2003 at 09:52 PM.
June 25th, 2003, 03:30 AM
Maybe you can wrap this is a small article explaining the idea and how to integrate in your code etc. and submit it to CodeGuru?
June 25th, 2003, 04:34 AM
June 25th, 2003, 06:20 AM
An easier solution....
I think this one is easier :
- add the LVS_EX_FLATSB extended style to your list control;
- use FlatSB_SetScrollProp to set the width and height of the scroll bars to zero.
June 25th, 2003, 06:35 AM
the ultimate way to dispose of the scrolls is.....
I managed to create a control that has an embedded tree & list
CListCtrlEx::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp)
ModifyStyle( WS_HSCROLL | WS_VSCROLL, 0 );
CListCtrl::OnNcCalcSize( bCalcValidRects, lpncsp );
control, using the above method, and also was able to provide
my own scrollbars in the controls non-client area.
June 25th, 2003, 06:46 AM
I'll think I will collect the different styles of removing the scrollbars and make an article about it...
Is it alright that I use your technique Filbert Fox?
June 25th, 2003, 06:50 AM
no problem, if you want to know how to set scrollbars in a client window then let me know, I am just finishing up on a project that demonstrates the above.
June 25th, 2003, 07:04 AM
If it is a demonstration prosject, then we can join together and write?
I've just published "MessageMod" to Codeguru, project and planetsourcecode... So I have some experience writing them...
Would that be interresting?
June 25th, 2003, 07:18 AM
If I had the time but I am very busy at the moment, but would be happy to supply any code or help if asked, the problem I am currently having is scrolling this is down to my controls being custom drawn, but should have solved very shortly, then I will send you project.
June 25th, 2003, 07:44 AM
Good... Thnx... I'll of cause give you credits for it...
Mail it to me at: firstname.lastname@example.org
May 27th, 2004, 04:39 PM
It has been some time, but you've been credited in several occations
Here are 3 links to the article I wrote:
Also the guy who made the skin clistctrl has given you credits:
Nice to know that your information is beeing used, and getting productive
Keep up, best regards
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.