From: Kuenga on
Hi,

I have few controls in CDialogBar like Listcontrol, editbox etc. When
the dialogbar is docked, the listcontrol get shrinked and not visible.
So thought of putting scrollbar, so that user have the option to
scroll when the controls are shrinked.

I tried the code given at http://support.microsoft.com/default.aspx?scid=kb;en-us;262954
and also at
http://www.codeproject.com/KB/dialog/scrolling_support.aspx

But in both I am facing the same problem that vertical scroll are not
visible and when clicked only the top and bottom arrow button of
vertical scroll bar comes up. When these are pressed, then the
controls are moved but it leaves trailing line on the Cdialogbar
frame. And also when CDialog bar is in floating mode, I believe it is
CMiniFrameWnd, when the scroll bars are pressed I get refressing
problem.

Has any one tried putting a scroll bar in a CDialogBar ? Any idea how
to solve the problem ?

Thanks

From: Kuenga on
On Aug 27, 6:33 pm, Kuenga <sagku...(a)gmail.com> wrote:
> Hi,
>
> I have few controls in CDialogBar like Listcontrol, editbox etc. When
> the dialogbar is docked, the listcontrol get shrinked and not visible.
> So thought of putting scrollbar, so that user have the option to
> scroll when the controls are shrinked.
>
> I tried the code given athttp://support.microsoft.com/default.aspx?scid=kb;en-us;262954
> and also athttp://www.codeproject.com/KB/dialog/scrolling_support.aspx
>
> But in both I am facing the same problem that vertical scroll are not
> visible and when clicked only the top and bottom arrow button of
> vertical scroll bar comes up. When these are pressed, then the
> controls are moved but it leaves trailing line on the Cdialogbar
> frame. And also when CDialog bar is in floating mode, I believe it is
> CMiniFrameWnd, when the scroll bars are pressed I get refressing
> problem.
>
> Has any one tried putting a scroll bar in a CDialogBar ? Any idea how
> to solve the problem ?
>
> Thanks

Hi,

I managed to get the scrollbar on the CDialogBar doing the work what
is done in OnSize in CalcDynamicLayout. Following is the code
snippet:-

CSize CDockingDlg::CalcDynamicLayout(int nLength, DWORD dwMode)
{
if(IsFloating())
EnableScrollBar(SB_VERT,ESB_DISABLE_BOTH);
if(dwMode & LM_VERTDOCK)
{
EnableScrollBar(SB_VERT,ESB_ENABLE_BOTH);

m_nCurHeight = size.cy;
int nScrollMax;
if (size.cy < m_rect.Height())
{
nScrollMax = m_rect.Height() - size.cy;
}
else
nScrollMax = 0;
SCROLLINFO si;
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_ALL; // SIF_ALL = SIF_PAGE | SIF_RANGE | SIF_POS;
si.nMin = 0;
si.nMax = nScrollMax;
si.nPage = si.nMax/10;
si.nPos = 2;
if(!SetScrollInfo(SB_VERT, &si, TRUE))
SetScrollRange(SB_VERT, 0, size.cy, TRUE);
}
m_nCurHeight = size.cy;
}

But when the dialogbar is docked, the Up and Left arrow of the
scrollBar, is not visible. The thumb is visible. The up and down
button becomes visible on clicking that area on the scrollbar.

Any idea what I need to do to make the Up and Down arrow button on the
scrollBar visible?