Cancel a zoom from a button using VBA
Operators can cancel a zoom at runtime by right-clicking on the control and then selecting
Undo Zoom/Pan
. However, you can also provide a button on the FactoryTalk View
SE display that can cancel a zoom.If you are setting up many buttons in your display, you can use the VBA option to help your application run faster.
To cancel a zoom from a button using VBA:
- Add a button to a graphic display, and then clickOK.
- Right-click the trend object and then selectVBA code.
- Return toFactoryTalk View Studio, right-click the button object and then selectVBA code.
- Type the name of the Trend object in the button released event code area.Private Sub Button1_Released()Trend1End Sub
- Press the period key and then selectCancelZoomfrom the list.Trend1.CancelZoom
- Test the display.
Provide Feedback