Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Resizing CMFCReBar

$
0
0

Have a VS2010 MFC GUI project. In CMainFrame::OnCreate, call Create on CMFCReBar, then create CDialog, then AddBar the CDialog to the CMFCReBar, then EnableDocking on the CMFCReBar, then DockPane the CMFCReBar. Rebar appears at bottom or top, consistent with setting in CMFCReBar Create, but nothing I do affects height of rebar. Regardless of height of CDialog that was AddBar to the CMFCReBar, and regardless of any SetWindowPos done to the CMFCReBar, the height of the rebar stays the same.

How to affect rebar height? Thanks.

if (!m_wndReBar.Create(this, RBS_AUTOSIZE, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_BOTTOM)
{
    TRACE0("Failed to create rebar\n");
    return(-1);
}
// try to increase rebar height this way
RECT wndReBarRect;
m_wndReBar.GetWindowRect(&wndReBarRect);
m_wndReBar.SetWindowPos(&wndTop, wndReBarRect.left, wndReBarRect.top, wndReBarRect.right - wndReBarRect.left, (wndReBarRect.bottom - wndReBarRect.top) * 2, SWP_SHOWWINDOW);
// add progress bar to bottom rebar
m_pwndProgress = new CProgressDialog(this);
m_pwndProgress->Create(IDD_DIALOG_PROGRESS, this);
// try to increase rebar height this way
RECT wndProgressBarRect;
m_pwndProgress->GetWindowRect(&wndProgressBarRect);
m_pwndProgress->SetWindowPos(&wndTop, wndProgressBarRect.left, wndProgressBarRect.top, wndProgressBarRect.right - wndProgressBarRect.left, (wndProgressBarRect.bottom - wndProgressBarRect.top) * 2, SWP_SHOWWINDOW);
// complete rebar setup m_wndReBar.AddBar(m_pwndProgress);
m_wndReBar.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndReBar);


Viewing all articles
Browse latest Browse all 15302

Trending Articles