SIF_DISABLENOSCROLL



Hi,

I am using the "CGridCtrl" class from thecodeproject.com, which is fairly
widely used. It is quite buggy but can be beaten into shape if you are
persistent enough. I only mention that I'm using it to point out that
there's a ton of code that I didn't write, so there might be a hidden bug
that I just haven't found.

It's a grid control for doing spreadsheet-type stuff. It automatically
shows scroll bars when the grid doesn't fit in the window's client area.
I'm having some really bizarre problems with the scroll bars -- and
apparently, I'm not the first, because the source is littered with comments
like "changed this to avoid infinite loop" wherever the scroll bars are
involved. And still, I occaisionally see infinite loops when scrolling
around the grid...

So, what I thought I would do is just force the scroll bars to always be
shown, but disabled when not needed. That would eliminate the constant
showing/hiding of the bars, which causes the client area to shrink/expand,
which causes the grid to recalculate its size, and so on and so on.

All I did was find all calls to CWnd::SetScrollInfo() and added the
SIF_DISABLENOSCROLL to the SCROLLINFO's fMask member. For good measure, I
also added it to any calls to CWnd::GetScrollInfo(), but the documentation
seems to say that it's ignored there.

The end result is that the scroll bars are always shown, sometimes
disabled, on *most* systems. On some systems (both XP and Win 7), though,
only the horizontal bar is shown and the vertical bar just disappears as if
I hadn't specified the SIF_DISABLENOSCROLL flag.

Any idea what I might be doing wrong, or what might be lurking somewhere in
the CGridCtrl code that is overriding my flag? I've searched the code
thoroughly for SetScrollInfo() calls and even "SIF_..." and there aren't
any matches.

Thanks.
.



Relevant Pages

  • Re: Having a real problem with grids.
    ... > is the height of the items grid on the orders form - scroll bars are ... > jump down the grid. ... It is never with a certain column or does not jump ... I usually even make it one pixel higher than that so I can see ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Inheritance and MFC
    ... Not Grid Excel type, ... To create a control, like a grid control, you'll likely want to start with ... or contains a CWnd at some point. ... adding scroll bars for pan, zoom, etc. ...
    (microsoft.public.vc.mfc)
  • Re: Datagrid View Scroll Bar Errors
    ... Keht wrote: ... I then reset the datatable adding different records and applying it to the grid. ... When I do this the scroll bars on the grid are grayed out as if they were disabled. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Datagrid scrollbar
    ... Whenever I resize the rows in the datagrid I had that happen. ... overcome it try resizing the grid to get the scroll bars to show. ... reduce the grid size by one pixel then reset it to the orginal size. ...
    (microsoft.public.dotnet.languages.vb)
  • RE: datagrid does not show scroll bars
    ... The panel scroll bars do not allow me to scroll the contents of the grid, only to scroll around the grid control. ...
    (microsoft.public.dotnet.languages.csharp)