Version

ViewBoxDragMode Property

Returns or sets a value indicating where the view box may be dragged within the page.
Syntax
'Declaration
 
Public Property ViewBoxDragMode As ViewBoxDragMode
public ViewBoxDragMode ViewBoxDragMode {get; set;}
Remarks

The ViewBoxDragMode is used to determine whether the view box may be repositioned with the preview pages. The viewbox is an area with a preview page that indicates the portion of the corresponding page in the PreviewControl is currently in view. Dragging the view box will change the preview pages that are currently in view with the associated PreviewControl.

Example
This snippet shows how to customize the look and feel of the UltraPrintPreviewThumbnail.

Private Sub PrintPreviewForm_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load

   ' Set the PreviewControl property to the UltraPrintPreviewControl on the Form.
   '
   Me.ultraPrintPreviewThumbnail1.PreviewControl = Me.ultraPrintPreviewControl1
   
   ' Give a gradient to the background of the thumbnail page image.
   '
   Me.ultraPrintPreviewThumbnail1.CurrentPreviewPageAppearance.BackColor = Color.LightGreen
   Me.ultraPrintPreviewThumbnail1.CurrentPreviewPageAppearance.BackColor2 = Color.Green
   Me.ultraPrintPreviewThumbnail1.CurrentPreviewPageAppearance.BackGradientStyle = Infragistics.Win.GradientStyle.ForwardDiagonal
   
   ' Customize the area in the thumbnail which displays the current page number.
   '
   Me.ultraPrintPreviewThumbnail1.CurrentPreviewPageNumberAppearance.ForeColor = Color.Red
   Me.ultraPrintPreviewThumbnail1.CurrentPreviewPageNumberAppearance.FontData.SizeInPoints = 12
   Me.ultraPrintPreviewThumbnail1.CurrentPreviewPageNumberAppearance.BackColor = Color.SeaGreen
   
   ' Give the viewbox a semi-transparent "film" of aquamarine.
   '
   Me.ultraPrintPreviewThumbnail1.ViewBoxAppearance.BackColor = Color.Aquamarine
   Me.ultraPrintPreviewThumbnail1.ViewBoxAppearance.AlphaLevel = 100
   
   ' Prevent the view box from appearing in any page that is not the current page.
   '
   Me.ultraPrintPreviewThumbnail1.ViewBoxDisplayStyle = Infragistics.Win.Printing.ViewBoxDisplayStyle.CurrentPreviewPage
   
   ' If the resolved value for ViewBoxDragMode is not 'RestrictWithinPage', make it so.
   '
   If Me.ultraPrintPreviewThumbnail1.ViewBoxDragModeResolved <> Infragistics.Win.Printing.ViewBoxDragMode.RestrictWithinPage Then
      Me.ultraPrintPreviewThumbnail1.ViewBoxDragMode = Infragistics.Win.Printing.ViewBoxDragMode.RestrictWithinPage
   End If

End Sub
private void PrintPreviewForm_Load(object sender, System.EventArgs e)
{
	// Set the PreviewControl property to the UltraPrintPreviewControl on the Form.
	//
	this.ultraPrintPreviewThumbnail1.PreviewControl = this.ultraPrintPreviewControl1;

	// Give a gradient to the background of the thumbnail page image.
	//
	this.ultraPrintPreviewThumbnail1.CurrentPreviewPageAppearance.BackColor = Color.LightGreen;
	this.ultraPrintPreviewThumbnail1.CurrentPreviewPageAppearance.BackColor2 = Color.Green;
	this.ultraPrintPreviewThumbnail1.CurrentPreviewPageAppearance.BackGradientStyle = Infragistics.Win.GradientStyle.ForwardDiagonal;

	// Customize the area in the thumbnail which displays the current page number.
	//
	this.ultraPrintPreviewThumbnail1.CurrentPreviewPageNumberAppearance.ForeColor = Color.Red;
	this.ultraPrintPreviewThumbnail1.CurrentPreviewPageNumberAppearance.FontData.SizeInPoints = 12;
	this.ultraPrintPreviewThumbnail1.CurrentPreviewPageNumberAppearance.BackColor = Color.SeaGreen;

	// Give the viewbox a semi-transparent "film" of aquamarine.
	//
	this.ultraPrintPreviewThumbnail1.ViewBoxAppearance.BackColor = Color.Aquamarine;
	this.ultraPrintPreviewThumbnail1.ViewBoxAppearance.AlphaLevel = 100;

	// Prevent the view box from appearing in any page that is not the current page.
	//
	this.ultraPrintPreviewThumbnail1.ViewBoxDisplayStyle = Infragistics.Win.Printing.ViewBoxDisplayStyle.CurrentPreviewPage;

	// If the resolved value for ViewBoxDragMode is not 'RestrictWithinPage', make it so.
	//
	if( this.ultraPrintPreviewThumbnail1.ViewBoxDragModeResolved != Infragistics.Win.Printing.ViewBoxDragMode.RestrictWithinPage )
		this.ultraPrintPreviewThumbnail1.ViewBoxDragMode = Infragistics.Win.Printing.ViewBoxDragMode.RestrictWithinPage;
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also