Page 19 - Open Soource Technologies 304.indd
P. 19

Unit 2: Working of VB Applications



               used by many VB programmers is none other than Visual Basic 6. We also have VB. Net, VB 2005,
               VB 2008 and the latest VB 2010. Both VB 2008 and VB 2010 are fully object oriented programming
               (OOP) language.
               VISUAL BASIC is a VISUAL and events driven Programming Language. These are the main
               divergence from the old BASIC. In BASIC, programming is done in a text-only environment and
               the program is executed sequentially. In VB, programming is done in a graphical environment.
               In the old BASIC, you have to write program code for each graphical object you wish to display
               it on screen, including its position and its color. However, in VB, you just need to drag and drop
               any graphical object anywhere on the form, and you can change its color any time using the
               properties windows.

               2.1 Working of VB Applications

               The fundamental aspects of developing a standard exe file, as well as an ActiveX EXE file. We
               also demonstrate the techniques for interacting between Standard EXE and ActiveX EXE programs
               by passing parameter values.

               2.1.1 Active Exe
               We develop a simple ActiveX EXE with just one form. The name of the ActiveX component is
               clsActivexEx. The example is chosen to demonstrate the use of ActiveX EXE in conjunction with
               Standard EXE.





























                           Figure 2.1:  Activex-1, Dialog Box Showing  the Type  of Project to Open.
               The selection (number/alphabet but not both) is passed on to the ActiveX EXE. Now, in the
               ActiveX EXE, you select specific number (say “2”) or alphabet (say “A”). That specific number
               or alphabet is again passed back to the Standard EXE. It is similar to, say, the Standard EXE selects
               either birds or animals. If the Standard EXE chooses birds, then the ActiveX EXE can choose any
               one of a given set of birds. It doesn’t have the option to choose any animal (because the Standard



                                      LOVELY PROFESSIONAL UNIVERSITY                         13
   14   15   16   17   18   19   20   21   22   23   24