Getting Started using Microsoft Visual Basic .NET

Note: This section assumes a simple knowledge of Visual Basic .NET. For further Visual Basic .NET, see the relevant documentation

SISCONST.VB

The ActiveX Control constants available to Visual Basic .NET are contained in an automatically generated Visual Basic .NET module file with the .VB extension.

The SISCONST.VB file is created as follows:

  • Run as a SIS version that can be customised using GisLink (Map Manager, Map Editor, Map Modeller) and select the Developer Control Bar
  • Select the Generate Programming File command (right-button) in the Developer Control Bar.

  • The Generate Programming File dialog will be displayed:

  • Check the SIS Control radio button and choose Visual Basic .NET from the drop-down list.
  • Fill in the Filename field (either by typing a filename or choosing one using the Browse button). The file will typically be called SISCONST.VB but you can choose any name.
  • Press the OK button to automatically generate the file.

Adding the ActiveX Control to a Visual Basic .NET Project

  • Start a new Visual Basic .NETSWD Project.
  • Add the SISCONST.VB (created above) to the project using the Project/Add Existing Item command.
  • Select the Components command from the Project menu (from the local, right-mouse menu in the Toolbox window or press Ctrl-T).
  • The list of controls on the Controls tab should contain the ActiveX Control. If the ActiveX Control is not in the list then check it is correctly installed and registered.
  • Having found the ActiveX Control in the list, check the box next to it and press OK.
  •  The Cadcorp SIS icon should now be visible in the Toolbox.
  • Press this icon to allow you to create an instance of the ActiveX Control on your form.
  • Press the mouse key over the form and hold it down to drag out the ActiveX Control to the desired size. Releasing the mouse key will create the ActiveX Control. The ActiveX Control will draw the SIS icon. Rename the ActiveX Control to "Sis" using the Properties Window.
  • Navigate to the Load event of the form and add the following code:
      Sis.LicenceKey = "enter your licence key here"
      Sis.LicenceSuffix = "enter your licence suffix here"
      Sis.Level = SIS_LEVEL_MANAGER
      Sis.SetAxesPrj "*APrjNatGrid"
      Sis.SetViewPrj "*APrjNatGrid"    
      Sis.CreateBackdropOverlay 0, "British National Grid"
  • Select the Run/Start command or press F5 to start the program.
  • The ActiveX Control should now show the outline of the United Kingdom. The map view can be manipulated using the scrollbars or the middle-mouse button or mousewheel where available.