VISUAL BASIC_6
 

9. Creating a User Defined ActiveX Control


Containers for placing ActiveX Controls:

ActiveX controls can be placed  in any of the following four containers.

1.      VB Design Form

2.      ActiveX Control Pad

3.      Microsoft Excel 97

4.      Microsoft Word 97

5.      ActiveX Control Test Container

1. ActiveX control placed in VB Design Form:

Open the Standard EXE Design Form.   At the bottom of the Toolbox, you must be able to find the icon by name rform for the new ActiveX control you have created..   If you don’t find it, open the component menu by clicking component from project menu.   You will find the ocx file by name rproj as shown in the figure 3.  Select it and click OK.   The icon by name rform will appear at the bottom of the toolbox.  Drag the new ActiveX control in the design form and size it so that all its components are clearly visible as shown in the figure 4.   Save the form as rrform and the project as rrproj.   Select start from the Run menu.   Now you can vary the drive, the directory and the files in the Run Mode..   Select a gif file and double click it.    You will get the corresponding image loaded in the picture box as shown in the figure 5.

 
                                      Figure 3

                                     Figure 4 


                                   Figure 5


 

Copyright © 2001 Selfonline-Education. All rights reserved.