Objective Grid: Determining scroll bar visibility

Article ID: 66
Last updated: 16 Apr, 2018
Article ID: 66
Last updated: 16 Apr, 2018
Revision: 3
Views: 2078
Posted: 12 Jan, 2001
by Meltreger B.
Updated: 16 Apr, 2018
by Meltreger B.

Problem


How can I determine if scroll bars are visible?


Cause



Action


The following code shows you how to determine if scrollbars are visible:

BOOL bLastRowVisible, bLastColVisible;
CRect rect = GetGridRect();

CalcBottomRowFromRect(rect, bLastRowVisible);
CalcRightColFromRect(rect, bLastColVisible);

// TRUE if scrollbar is needed...
BOOL bVertScrollbar = GetTopRow() > GetFrozenRows() +1 || !bLastRowVisible;

// TRUE if scrollbar is needed...
BOOL bHorzScrollbar = GetLeftCol() > GetFrozenCols() +1 || !bLastColVisible;

This article was:   Helpful | Not helpful
Report an issue
Article ID: 66
Last updated: 16 Apr, 2018
Revision: 3
Views: 2078
Posted: 12 Jan, 2001 by Meltreger B.
Updated: 16 Apr, 2018 by Meltreger B.

Others in this category