Objective Grid: Scrollbars in tab windows

Article ID: 714
Last updated: 11 Jun, 2018
Article ID: 714
Last updated: 11 Jun, 2018
Revision: 3
Views: 1897
Posted: 11 Jan, 2001
by Meltreger B.
Updated: 11 Jun, 2018
by Meltreger B.

Problem


I'm using CGXTabWnd and embedding classes derived from CListView.  I'm having trouble getting the scroll bars right.  I've overridden GetScrollBarCtrl() in my view class and return a pointer to the tab window's scroll bar.
 


Cause


The problem is that all CCtrlView derivatives (like CListView) don't let you override GetScrollBarCtrl(). GetScrollBarCtrl() is simply never called from within MFC because all the controls must have their own scrollbars and therefore you cannot share these scrollbars with the tab window.
 


Action


The only solution here is to turn off the tab window scrollbars in OnActivateView().

Example:
 

void CGXEditView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView)
{
CGXTabWnd* pTabWnd = GetParentTabWnd(this, TRUE);

if (pTabWnd != NULL)

pTabWnd->ShowScrollBar(SB_BOTH, !bActivate);
CEditView::OnActivateView(bActivate, pActivateView, pDeactiveView);
}


 
 

This article was:   Helpful | Not helpful
Report an issue
Article ID: 714
Last updated: 11 Jun, 2018
Revision: 3
Views: 1897
Posted: 11 Jan, 2001 by Meltreger B.
Updated: 11 Jun, 2018 by Meltreger B.

Others in this category