Page Appearance

Created:2/19/2002
Description:

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 display.

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:
  1. Either run the PageAppearance.exe or open the PageAppearance.vbp and run from within the project.
  2. Browse and select a map document to load into the PageLayoutControl.
  3. Change the page border, background, color and shadow properties.

Application:
PageLayoutControl

Minimum ArcGIS Version Required: 8.2

Difficulty: Intermediate


Visual Basic
File Description
PageAppearance.frm VB form file for the PageAppearance project.
PageAppearance.frx VB Binary file.
PageAppearance.vbp VB Project file.


Key CoClasses: PageLayoutControl
Key Interfaces: IArray, IEnumStyleGalleryItem, IFrameProperties, IPage, IPropertySupport, IStyleGallery, IStyleGalleryClass, IStyleGalleryItem, IUknown
Key Members: CheckMxFile, LoadMxFile, Extent, Page, PageLayout, Pan, TrackRectangle, ZoomToWholePage