To add a Windows Forms grid control in Visual Basic 6.0 we should follow the below steps.
Step 1: Create new WF library project.
Step 2: Add form and necessary control to the project.
Step 3: Include below class libraries for InterOp functions.
Adding InterOP function
Step 4: Need to register Com objects, below code snippet in class file for com registration.
Step 5: Need to check COM object visibility in Properties -> Application -> Assembly Information -> Check Make assembly COM – visible.
Step 6: Need to check register for COM interop via Properties -> Build -> Register for COM interop.
Step 7: Rebuild the application and generate project assembly.
Step 8: Open visual studio command prompt as administrator. And execute below command.
By following above steps generated assembly will be registered in local machine and so it will be exposed as ActiveX control. And it can have tested via opening it in VS ActiveX control test container.
Step 9: For testing functionality, Open Active-X test container in below location.
C:\Program Files (x86) \Microsoft Visual Studio 8\Common7\Tools\tstcon32.exe
Step 10: Select Edit -> Add New Control -> above control will be available in this location and by double clicking on it, that will be integrated in VBA container.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|