Page 46 - Computing Book 8
P. 46

Developing Applications – Visual Studio                                              Class 8


                                     Developing Applications – Visual Studio

               This chapter focuses on the use of Microsoft Visual Studio IDE
               (integrated development environment), it is used to develop computer
               programs, as well as websites, web apps, web services and mobile
               apps.
               First Visual Basic Program:

               As we all know, a Computer program is a set of instructions,
               using visual studio IDE we create a Windows form program,
               follow the steps below:
               1.  Open visual studio
               2.  Click new project
               3.  Select Windows Forms Application
               4.   Type name of program “myfirstVBform” and it will be
                   automatically saved to this location documents\visual
                   studio 2010\projects
               5.  On the lower right of the screen, you can see the
                   Properties Panel which allows you to define various
                   properties of the currently selected element on the
                   design view. Some commonly used properties are:
                   the Text property which defines the title of the
                   selected element, the Name property which defines
                   a name with which we can refer to the selected
                   element in our program’s code (more on that later
                   on) and the Enabled property which defines if the selected element
                   will be usable or disabled.
               6.  Select the text and enter the form title as “First VB form”
               7.  The form we have created is currently empty and to make it
                   purposeful we add elements called Controls. There are two types of
                   basic controls Buttons and Labels. Buttons work to trigger specific
                   commands whereas labels work as traditional labels to name
                   something.
               8.  To access these controls, place the mouse cursor on the extreme left
                   of the screen where Toolbox is written and click on the pin icon to
                   show the toolbox panel permanently.
               9.  To add any control on your form simply drag & drop the control from the toolbox panel to your
                   form to the preferred location.
               10. Add a button and label on your form.
               11. While placing these controls on your form gridlines will help you to
                   place these elements symmetrically.
               12. Select the button and change the text to “Say Hello World” from properties panel on the right.
               13. Then scroll down the properties panel and in Design section change the
                   (Name) to btnReaction
               14. Do the same with label properties and change the name with
                   lblReaction




               The City School /Academics/Computing Curriculum/Class 8/2020-2021                Page 45 of 75
   41   42   43   44   45   46   47   48   49   50   51