Resizable Dialogs and Forms
BCGControlBar Pro (MFC)
BCGSuite (MFC)
BCGControlBar for .NET
Layout managers are responsible for automatic reposition of controls hosted in a window for which layout management is enabled. You can enable layout management for the following objects:
- dialogs
- dialog bars (panes)
- property sheets
- form views
A class, for which layout management is enabled, is called "host window". Its child controls are anchored to its edges. You can also specify a distance between controls and edges, and "move type", which defines how a child control is repositioned when its host is resized.
Dialog in initial state:
Dialog after resizing:
Sample code:
CMyDialog::CMyDialog()
{
// Enable controls layout:
EnableLayout();
}
BOOL CMyDialog::OnInitDialog()
{
CBCGPDialog::OnInitDialog();
CBCGPStaticLayout* pLayout =
(CBCGPStaticLayout*)GetLayout();
if (pLayout != NULL)
{
// Add controls to layout:
pLayout->AddAnchor(
IDOK,
CBCGPStaticLayout::e_MoveTypeBoth,
CBCGPStaticLayout::e_SizeTypeNone);
pLayout->AddAnchor(
IDCANCEL,
CBCGPStaticLayout::e_MoveTypeBoth,
CBCGPStaticLayout::e_SizeTypeNone);
pLayout->AddAnchor(
IDC_EDITBOX,
CBCGPStaticLayout::e_MoveTypeNone,
CBCGPStaticLayout::e_SizeTypeBoth);
}
return TRUE;
}