This sample demonstrates changing the border, background, color and shadow effects of the
PageLayoutControl's page using one, some or all of the following interfaces: IPage;
IFrameProperties; and IPropertySupport.
The Microsoft Common Dialog Control (Comdlg32.ocx) allows users to search and select map
documents, which are validated and loaded into the PageLayoutControl using the CheckMxFile and
LoadMxFile methods. The visible extent of the PageLayout is set with the ZoomToWholePage method
and the TrackRectangle and Pan methods within the OnMouseDown event to zoom in and pan the
The Form_Load event is used to loop through each style in a StyleGalleryClass (Borders,
Backgrounds, Colours and Shadows) using the IEnumStyleGalleryItem interface. Each
StyleGalleryItem is added to an Array and its Name added to a ListBox at the same index.
When a user double clicks on a StyleGalleryItem name in a ListBox the Symbol is taken
from the same index position in the appropriate Array and is applied to the PageLayoutControl's
page in one of three ways. Firstly, using the IPage Border, Background and BackgroundColor
properties. Secondly, using the IFrameProperties Border, Background and Shadow properties.
Thirdly, using the IPropertySupport interface to see whether the symbol can be applied.
How to use:
Either run the PageAppearance.exe or open the PageAppearance.vbp and run from within the project.
Browse and select a map document to load into the PageLayoutControl.
Change the page border, background, color and shadow properties.