Zooming using SOAP Controls

You can add the ability to zoom in and out by fixed scale factors and zoom back to the extent of the SWD.

To do this:

  1. From the Web Forms toolbox, add three buttons to WebForm1.aspx and change their IDs to zoomInButton, zoomOutButton and zoomExtentButton.
  2. Change their Text properties to be meaningful and position them as you see fit.
  3. Double-click each button in turn and Visual Studio will create a template event-handling method for each.
  4. Fill in the methods as below to define what happens when each button is pressed:
Private Sub zoomInButton_Click(ByVal sender As System.Object, 
ByVal e As System.EventArgs) Handles zoomInButton.Click
End Sub

Private Sub zoomOutButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles zoomOutButton.Click
End Sub

Private Sub zoomExtentButton_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles zoomExtentButton.Click
End Sub

Press F5 to run the application and check the buttons zoom the display as you expect.

The zoom-in and zoom-out buttons should zoom by a factor of 2 every time they are pressed.