As the view of the UltraPrintPreviewControl changes, a history is maintained of the areas of the pages that have been viewed. This is the view history. The HasPreviousView and HasNextView are used to indicate if there are entries in the specified direction within the view history. The PerformAction can then be used with values of PreviousView and NextView respectively to navigate within the view history.
Note: There is a limit on the history depth that will be maintained. Once that depth is reached, subsequent history entries will remove the earliest entries as needed.
Private Sub PrintPreviewForm_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load ' When the Form first loads, there is no view history to navigate ' so both navigation buttons should be disabled. ' Me.btnNextPointInHistory.Enabled = False Me.btnPrevPointInHistory.Enabled = False End Sub Private Sub ultraPrintPreviewControl1_ViewHistoryChanged(sender As Object, e As System.EventArgs) Handles Me.ultraPrintPreviewControl1.ViewHistoryChanged ' After the view history has been navigated we need to update the Enabled state ' of both navigation buttons in case the user has reached the beginning or end of ' the view history. ' Me.btnNextPointInHistory.Enabled = Me.ultraPrintPreviewControl1.HasNextView Me.btnPrevPointInHistory.Enabled = Me.ultraPrintPreviewControl1.HasPreviousView End Sub Private Sub btnNextPointInHistory_Click(sender As Object, e As System.EventArgs) Handles Me.btnNextPointInHistory.Click ' Make the control display the point in the view history "after" the current view point. ' Me.ultraPrintPreviewControl1.PerformAction(Infragistics.Win.Printing.UltraPrintPreviewControlAction.NextView) End Sub Private Sub btnPrevPointInHistory_Click(sender As Object, e As System.EventArgs) Handles Me.btnPrevPointInHistory.Click ' Make the control display the point in the view history "before" the current view point. ' Me.ultraPrintPreviewControl1.PerformAction(Infragistics.Win.Printing.UltraPrintPreviewControlAction.PreviousView) End Sub
private void PrintPreviewForm_Load(object sender, System.EventArgs e) { // When the Form first loads, there is no view history to navigate // so both navigation buttons should be disabled. // this.btnNextPointInHistory.Enabled = false; this.btnPrevPointInHistory.Enabled = false; } private void ultraPrintPreviewControl1_ViewHistoryChanged(object sender, System.EventArgs e) { // After the view history has been navigated we need to update the Enabled state // of both navigation buttons in case the user has reached the beginning or end of // the view history. // this.btnNextPointInHistory.Enabled = this.ultraPrintPreviewControl1.HasNextView; this.btnPrevPointInHistory.Enabled = this.ultraPrintPreviewControl1.HasPreviousView; } private void btnNextPointInHistory_Click(object sender, System.EventArgs e) { // Make the control display the point in the view history "after" the current view point. // this.ultraPrintPreviewControl1.PerformAction( Infragistics.Win.Printing.UltraPrintPreviewControlAction.NextView ); } private void btnPrevPointInHistory_Click(object sender, System.EventArgs e) { // Make the control display the point in the view history "before" the current view point. // this.ultraPrintPreviewControl1.PerformAction( Infragistics.Win.Printing.UltraPrintPreviewControlAction.PreviousView ); }
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