 |
|
 |
Thanks,
It worked for me.
|
|
|
|
 |
|
 |
With LVS_NOSCROLL | LVS_ALIGNTOP | LVS_ICON, my listctrl can show two column nicely (consider the margins between icons);
But when LVS_NOSCROLL is removed and HideScrollBars(LCSB_NCOVERRIDE); is called, only one column can't be shown. Any solution?
BTW, I also tried LCSB_CLIENTDATA, the list ctrl disappears. (my ctrl has no border)
system
|
|
|
|
 |
|
 |
Thank you, Large! It really helps me
Best regards,
Denis
|
|
|
|
 |
|
 |
Hi,
I tried it out on NT, it works pretty fine... but since NcCalcSize is an unsupported function in CE OS, can you please suggest a workaround for hiding scrollbars.
|
|
|
|
 |
|
 |
In order to hide them on CE I just deleted the NCCalcSize function
and removed the type parameter (1st parameter) from the HideScrollBar function.
So its like always hiding by using the LCSB_CLIENTDATA type....
that seems to work... Only bad thing is that the border around the listcontrol is not drawn completely correct ( right and bottom border are gone)
Regards,
Davy
|
|
|
|
 |
|
 |
Ok... but if listctrl have a less item and scrollbar was not create
then listctrl abnormal size....
None
|
|
|
|
 |
|
 |
I tried like this
this->SetScrollRange(SB_HORZ,0,0);
this->SetScrollPos(SB_HORZ,0);
this->ShowScrollBar (SB_HORZ,FALSE);
but not able to remove or hide them.
any help please ?
Regard
Sudha
|
|
|
|
 |
|
 |
Please read the article! You can modify any CListCtrl with my technique.
A CFormView is a dialog-window in a CView class, and I guess could try to use the same technique. But I've never done it...
=====================
Lars [Large] Werner
lars@werner.no
http://lars.werner.no
=====================
|
|
|
|
 |
|
 |
Nope
After using that function also same problem
|
|
|
|
 |
|
 |
In Inherited CFormView Class, I used your code and just called
HideScrollBars(LCSB_CLIENTDATA); in OnCreate function
Actually this class is binded with Splitter window
|
|
|
|
 |
|
 |
Have you tried overriding OnSize and calling
ShowScrollBar(SB_BOTH, FALSE);
after calling the base class.
This removes the scrollbars from a CFormView without any
problem.
|
|
|
|
 |
|
 |
Hi mjw1
Thats works great on a SDI/MDI app Thanks for the tip
=====================
Lars [Large] Werner
lars@werner.no
http://lars.werner.no
=====================
|
|
|
|
 |
|
|
 |
|
 |
It's simple and works so fine.
Thanks~
|
|
|
|
 |
|
 |
Thnx, glad you liked it!
=====================
Lars [Large] Werner
lars@werner.no
http://lars.werner.no
=====================
|
|
|
|
 |
|
 |
In your demo project, why List1 and List3 are different in height. BTW, your code is very nice,
Regards,
QuangNT
|
|
|
|
 |
|
 |
I guess you're refering to the LCSB_CLIENTDATA type of hiding scrollbars.
I use the ClientRect to get the size of the window. And it will give the rect that fills the white in the back of the scrollbar. Since I've not found any good solution to get the border of the listctrl I've added to remove some pixels at det bottom/right. Meaning that it should be +/- 2pixels wrong when using LCSB_CLIENTDATA (That is using SetWindowRgn to hide the scrollbars, as explained in the code for known issues). I've not corrected it, since the LCSB_NCOVERRIDE is much easier to use, and I couldn't find an easy solution to the SetWindowRgn problem.
=====================
Lars [Large] Werner
lars@werner.no
http://lars.werner.no
=====================
|
|
|
|
 |
|
 |
Use GetWindowRect and ScreenToClient to get the correct size of window with all the borders. In that case you don't need to subtract 2 pixels
Igor Nedelko
|
|
|
|
 |
|
 |
i undergo same problem.. so i add some code to here..
// Draw the background if needed
if( m_nHighlight == HIGHLIGHT_NORMAL )
{
pDC->FillRect(rcCol, &CBrush(::GetSysColor(COLOR_WINDOW)));
}
/* Add here, start */
if( bHighlight )
{
pDC->SetTextColor(::GetSysColor(COLOR_HIGHLIGHTTEXT));
pDC->SetBkColor(::GetSysColor(COLOR_HIGHLIGHT));
pDC->FillRect(rcCol, &CBrush(::GetSysColor(COLOR_HIGHLIGHT)));
}
else
{
pDC->FillRect(rcCol, &CBrush(::GetSysColor(COLOR_WINDOW)));
}
/* end */
nthroot at madnom.com
|
|
|
|
 |
|
 |
Could you please clarify the role of LCSB_CLIENTDATA and LCSB_NCOVERRIDE ?
For instance, what is the difference between:
MyListCtrl.HideScrollBars(LCSB_CLIENTDATA, SB_BOTH);
and
MyListCtrl.HideScrollBars(LCSB_NCOVERRIDE, SB_BOTH);
Very useful implementation, however
Regards.
|
|
|
|
 |
|
 |
Hi Stlan!
The difference between the LCSB_CLIENTDATA and LCSB_NCOVERRIDE is:
The CLIENTDATA "mode" is a technique that makes the window first expand the width and height of the window with the size of the scrollbars...
After it have resized the window to +scrollbarsize it set the Range of the window (what you view) to currentsize-scrollbarsize... That way the scrollbars are still there, but they are not shown...
The NCOVERRIDE is called each time it calc the width of an element.... Each time it does that, it removes the style of scrollbars.... That way you get the scrollbar function, but the scrollbars aren't showed...
NCOVERRIDE is a prefered way, since it does not remove the frame border from the listctrl...
Hopefully that made it all clearer!
=====================
Lars [Large] Werner
lars@werner.no
http://lars.werner.no
=====================
|
|
|
|
 |
|
 |
I have following problem:
i have a list in my application that i would like to use like a viewer for large tables. Cause i handle with large databases with over 300.000 rows, i want to fill my list only with few rows (100 for example), and then if user scrolls the list i fill raws on the one side and removes on the other so that user has an impression an entire table in the List.
Now my question: how can i find out when user moves the scrollbar? Is there any message that will be send by ListCtrl? And how can i get controll of the Scrollbar of the list controll?
ws
PS VScroll-messages do not work. I don't know why.
|
|
|
|
 |
|
 |
Well... You don't need to make the wheel again!
Check out this: http://www.codeguru.com/listview/virtualListview.html
Microsoft has implemented a OWNERDATA function that only show's the information given by it screen...
In other words, you can implement over 200-300.000 entries in 10 cols without any lagg or speedloss!
===================
Lars [Large] Werner
lars@werner.no
===================
|
|
|
|
 |
|
 |
Hi Lars,
here is another way to hide scroll bars:
define a function in your derived from CListCtrl class like: void Init(),
call it from OnInitDialog()
void CMyListCtrl::Init()
{
InitializeFlatSB(this->m_hWnd);
FlatSB_EnableScrollBar(this->m_hWnd, SB_BOTH, ESB_DISABLE_BOTH);
}
enjoy.
|
|
|
|
 |
|
 |
Hi there Glip...
I tried it on the test project I made... And it did hide the scrollbars. But it wouldn't show one of the scrollbars and hide the rest. Did you have the same experience?!
Here is the code:
if(Type==LCSB_FLATHIDE) //Thnx to: glip@codeproject
{
InitializeFlatSB(this->m_hWnd);
if(Which==SB_BOTH) FlatSB_EnableScrollBar(this->m_hWnd, Which, ESB_DISABLE_BOTH);
if(Which==SB_HORZ) FlatSB_EnableScrollBar(this->m_hWnd, Which, ESB_DISABLE_LEFT|ESB_DISABLE_RIGHT|ESB_DISABLE_LTUP|ESB_DISABLE_RTDN);
if(Which==SB_VERT) FlatSB_EnableScrollBar(this->m_hWnd, Which, ESB_DISABLE_DOWN|ESB_DISABLE_LTUP|ESB_DISABLE_RTDN|ESB_DISABLE_UP);
}
The Which variable contains either SB_BOTH, SB_HORZ or SB_VERT!
===================
Lars [Large] Werner
lars@werner.no
===================
|
|
|
|
 |