Gets or sets the location of the top left corner of the preview area (the scroll position) within the preview window. The value is relative to the PreviewRectangle, not to the ClientRectangle. The value is independent of the ZoomFactor (i.e. setting the same values will scroll to the same logical position in the document at any zoom factor).

Namespace:  C1.Win.C1Preview
Assembly:  C1.Win.C1Report.2 (in C1.Win.C1Report.2.dll)

Syntax

C#
[BrowsableAttribute(false)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
public PointF PreviewScrollPosition { get; set; }
Visual Basic
<BrowsableAttribute(False)> _
<DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)> _
Public Property PreviewScrollPosition As PointF
	Get
	Set

Field Value

The scroll position (unzoomed).

Examples

The following example sets the MaxZoomFactor to 200%:

Copy CodeVisual Basic
' Re-generates the document keeping the current preview position.
Private Sub RegenerateDocument(ByVal doc As C1.C1Preview.C1PrintDocument)
    Dim layoutSection As New C1.Win.C1Preview.C1PreviewPane.LayoutSection(C1PrintPreviewControl1.PreviewPane, HistorySavedActionsEnum.None)
    Dim pos As PointF = C1PrintPreviewControl1.PreviewPane.PreviewScrollPosition
    doc.Generate()
    C1PrintPreviewControl1.PreviewPane.PreviewScrollPosition = pos
    layoutSection.Dispose()
End Sub
Copy CodeC#
// Re-generates the document keeping the current preview position.
private void RegenerateDocument(C1.C1Preview.C1PrintDocument doc)
{
    C1PreviewPane layoutSection = new C1.Win.C1Preview.C1PreviewPane.LayoutSection(C1PrintPreviewControl1.PreviewPane, HistorySavedActionsEnum.None);
    PointF pos = new C1PrintPreviewControl1.PreviewPane.PreviewScrollPosition;
    doc.Generate();
    layoutSection.Dispose();
}

For a full example, see the ObjectCoordinates sample.

See Also