This document is archived and information here might be outdated.  Recommended version.


IPageLayoutControl3.Refresh Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IP > IPageLayoutControl3 Interface > IPageLayoutControl3.Refresh Method
ArcGIS Developer Help

IPageLayoutControl3.Refresh Method

Redraws the PageLayout, optionally just redraw specified phases or envelope.

[Visual Basic .NET]
Public Sub Refresh ( _
    [ByVal phase As esriViewDrawPhase], _
    [ByVal layerOrElement As Object], _
    [ByVal envelope As Object] _
)
[C#]
public void Refresh (
    esriViewDrawPhase phase,
    object layerOrElement,
    object envelope
);
[C++]
HRESULT Refresh(
  esriViewDrawPhase phase,
  VARIANT layerOrElement,
  VARIANT envelope
);
[C++]
Parameters
phase [in, optional, defaultvalue()]

phase is a parameter of type esriViewDrawPhase layerOrElement [in, optional]
layerOrElement is a parameter of type VARIANT
To indicate this parameter is undefined pass in a VARIANT with type VT_ERROR and scode value of DISP_E_PARAMNOTFOUND. envelope [in, optional]
envelope is a parameter of type VARIANT
To indicate this parameter is undefined pass in a VARIANT with type VT_ERROR and scode value of DISP_E_PARAMNOTFOUND.

Product Availability

Available with ArcGIS Engine.

Description

Use the Refresh method to redraw the display. If the Refresh method is used and no arguments are supplied the refresh is based upon the IActiveView::Refresh method.

In all other cases the refresh is based upon the IActiveView::PartialRefresh method. The Refresh method supports the esriViewDrawPhases given below:

0   :esriViewNone

1   :esriViewBackground

2   :esriViewGeography

4   :esriViewGeoSelection

8   :esriViewGraphics

16 :esriViewSelection

32 :esriViewForeground

If the Refresh method is used and no phase argument is supplied, but one of the other arguments is supplied then all phases will be refreshed and the phase value will be 65535. Always supply a phase whenever possible to increase efficiency.

Use the layerOrElement argument to refresh a particular layer or graphic element. Use the envelope argument to refresh only a particular region. For example, if a new graphic is added you may only want to refresh the area surrounding the graphic.

Remarks

Use the TrackCancel object to set whether users can stop drawing processes by using the escape or spacebar keys or by clicking the mouse.

[C#]

//Based upon IActiveView::Refresh
axPageLayoutControl1.Refresh((esriViewDrawPhase) 65535, Type.Missing, Type.Missing);

//Based upon IActiveView::PartialRefresh
axPageLayoutControl1.Refresh(esriViewDrawPhase.esriViewGraphics, Type.Missing, Type.Missing);              //Refresh all elements
axPageLayoutControl1.Refresh(esriViewDrawPhase.esriViewGraphics, element, Type.Missing);    //Refresh an element
axPageLayoutControl1.Refresh(esriViewDrawPhase.esriViewGraphics, Type.Missing, envelope); //Refresh an envelope

[Visual Basic .NET]

'Based upon IActiveView::Refresh
AxPageLayoutControl1.Refresh()

'Based upon IActiveView::PartialRefresh
AxPageLayoutControl1.Refresh(esriViewDrawPhase.esriViewGraphics)              'Refresh all elements
AxPageLayoutControl1.Refresh(esriViewDrawPhase.esriViewGraphics, pElement)    'Refresh an element
AxPageLayoutControl1.Refresh(esriViewDrawPhase.esriViewGraphics, , pEnvelope) 'Refresh an envelope

See Also

IPageLayoutControl3 Interface