1 / 27

Visual Basic

Visual Basic. Week 1. What is Visual Basic?. Visual Basic is an easy to learn programming language Can develop Windows based applications Visual Basic is an easy yet powerful programming language. Advantages of VB. Simple Popular = lots of resources

sumana
Télécharger la présentation

Visual Basic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Visual Basic Week 1

  2. What is Visual Basic? • Visual Basic is an easy to learn programming language • Can develop Windows based applications • Visual Basic is an easy yet powerful programming language

  3. Advantages of VB • Simple • Popular = lots of resources • Many tools available on the Internet to save you some programming time

  4. Disadvantages of VB • Not suitable for programming sophisticated games • Slower than other languages

  5. Getting Started

  6. Start New Project

  7. Name Project

  8. Development Environment

  9. Getting Started (continued) • Look at the form with the title bar Form1 • Everything you place on this form will appear in your program • To run your program click on the Play button on the toolbar

  10. Getting Started (continued) • To stop the program click the form’s X button or select the Stop button on the tool bar

  11. Properties • Every component/object of your program has properties that determine its look and function • For Example: Font, Fore Color, Icon, Text • To see the properties window, select View -> Properties Window from the menu bar

  12. Properties (continued)

  13. Properties (continued)

  14. Changing Properties • Change the form’s Text property

  15. Adding Controls • There are many control that can be added to your program • For example: buttons, text boxes, scroll bars and more • The controls are listed in the toolbox

  16. ToolBox

  17. Adding Controls • Double Click • Drag and Drop • Click and Locate

  18. Changing Properties • Right-click on the control • Select the control from the properties window control box

  19. Events • VB is an Event Driven language • Events are actions that are taken in the program • For example: keypress, mouseover, click and many more • Events are coded in the Code window

  20. Code Window

  21. Form_Load Event • The form load event should look like this: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load (The beginning of the Form_Load event)This is the code that belongs to the Form_Load eventEnd Sub (The end of the Form_Load event)

  22. Add a Message Box • Adding a message box to the form load event • Add MsgBox(“Hello”) • Between the Private Sub and the End Sub statements • Run Program

  23. More Events • Click the Drop-Down List that appears in the upper left corner of the code window to choose the object

  24. More Events • Click the Drop-Down List that appears in the upper right corner of the code window to see the events

  25. FormClosing Event • The FormClosing event occurs when the form is being unloaded when you click the form’s X button • Type MsgBox("Good Bye") between the Private Sub and the End Sub statements • Run the program • Close the program

  26. Command Button’s Events • Double-click or right-click and select View Code to open the code window for the command button • Type MsgBox("You have Clicked on the button!") between the Private Sub and the End Sub statements • Run the program and click on the command button

More Related