Add the Visual Basic Form

Visual LANSA

Add the Visual Basic Form

In this step you create the Visual Basic form which contains the LANSA ActiveX control:

To create the form:

1.  Complete the General Setup Tasks to create a new Visual Basic project.

2.  Close Visual Basic.

3.  Start Notepad, open the form (Form<n>.frm) created in the General Setup Tasks.

4.  Replace the code in Notepad with the source code from Case 2 - Visual Basic - Object, then save it.

5.  Open the Project (Project<n>.vbp) in your Visual Basic development environment.

6.  Open the form (Form<n>.frm)

7.  Replace the code with the source code from Case 2 - Visual Basic - Code, then Save it.

8.  Right click in the Visual Basic toolbox and select Components from the pop-up menu.

9.  Scroll down and check LANSA.AXPANELA.  This will add an icon for the AXPANEL control to the toolbox

10.  Click on the AXPANELIA icon to select it and on the form drag out a rectangle and release the left mouse key to include the LANSA ActiveX control to the form:

11. View the properties of the ActiveX control and change the name from AXPANELA1 to AXPANELA.

     Notes:

  • If your Toolbox is not displayed, click View then Toolbox.
  • To view the forms user interface design, Click View, then click Object from the Menu or by using the Project Pane.

12. In the LOAD routine modify the login script below to your requirements.  For example:

      Call ConnectToLansa("user1", "mypassword", "c:\ActiveXTests\session.cfg")

 

 

13. Save, then compile the Visual Basic Project using the Make Project<n>.exe option in the File menu.

     You can now view the sample Personnel data by executing the program and typing in an Employee Number, then clicking on Show.

   

 

Ý Case 2 - Embed a Reusable Part