Home > Code Library > SmartViewport > Refresh

Last Update 24 May 2001

 


Search:



  

Options:

   

   

   

   



SmartViewport
Reference

Refresh Method

Forces a complete refresh of the viewport. This method is particularly useful when controls are added dynamically at run-time.

Syntax

object.Refresh

The object placeholder represents an object expression that evaluates to a SmartViewport object.

Remarks

When controls are dynamically added at run-time or when the dimension and/or position of a contained control is changed from code, method Refresh will force the viewport to re-calculate its virtual page bounds.

Example:

'Add a CommandButton to SmartViewport1
'with properties [Left=135;Top=135;Index=0]


'Current PageTop returns 0
Debug.Print "PageTop = "; SmartViewport1.PageTop

'Load a new instance of Command1
Load Command1(1)
Command1(1).Top = -1200
Command1(1).Visible =
True

'Refresh the viewport
SmartViewport1.Refresh

'Current PageTop is now -1200
Debug
.Print "PageTop = "; SmartViewport1.PageTop


 
Copyright © 2001, Andrés Pons (andres@vbsmart.com). All rights reserved.