1 / 30

Introduction to Visual Studio

Introduction to Visual Studio. Visual Basic.Net. Software to Install. Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available from MSDNAA. What is Visual Basic.Net. 4 th Generation Programming Environment / Development Language

lorid
Download Presentation

Introduction to Visual Studio

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. Introduction to Visual Studio Visual Basic.Net

  2. Software to Install • Visual Studio 2005 Professional Edition (Requires Windows XP Pro) • MSDN Library for Visual Studio 2005 Available from MSDNAA

  3. What is Visual Basic.Net • 4th Generation Programming Environment / Development Language • Based on BASIC language • Beginners All-Purpose Symbolic Instructional Code • Most widely used tool for developing Windows Applications • Graphical User Interface (GUI) • Menus, Buttons, Icons to help the user • Full Object-Oriented Programming Language

  4. Visual Studio.NET • A platform that allows the development and deployment of desktop and web applications • Allows user choice of many .NET languages • May program in One of them • May create different parts of application in different languages • Visual Basic • C# (C Sharp) • C++ • J++ • Etc.

  5. Visual Studio.NET • Integrated Development Environment – allows the automation of many of the common programming tasks in one environment • Writing the code • Checking for Syntax (Language) errors • Compiling and Interpreting(Transferring to computer language) • Debugging (Fixing Run-time or Logic Errors) • Running the Application

  6. Using Visual Studio.NET

  7. Creating an Application • Select the “Create Project” option from the “Recent Projects” box on the Start Page

  8. Default Settings

  9. Design Window Toolbox Solution Explorer Properties Window

  10. Creating the Application Step 1: Add a Control to the Form Add a Button to the Form • Look in the Toolbox for the Button Control • Select the Button with the Mouse • Draw a Rectangle Region in the Design Window by holding the mouse button down • Release the mouse button to see your button • (Can also be added by double clicking on the button in the Toolbox)

  11. Creating the Application • Add a Second Button to the Form • Put it in the lower right corner • The project now contains a form with 2 button controls

  12. Setting Control Properties • Properties • Determine the Look and Feel (and sometimes behavior) of a Control • Set through the Properties Window • Properties Set for this Application • Name • Text

  13. Setting Control Properties • Click on the Control in the Design Window • Select the appropriate property in the Properties Window

  14. Control Name • Should be Meaningful • NOT button1, form1, textbox1 • Should begin with a 3 character prefix • Button  btn • Label  lbl • Textbox  txt • Set the name of button1 to btnWelcome • Set the name of button2 to btnExit

  15. Text Property • Determines the visible text on the control • Change the text property • bntWelcome  set to “Say Welcome” • btnExit  set to “Exit” • Do not need to include the “ “ in your text field • Notice how the buttons now display the new text

  16. Add the Code • To Make the GUI Functional • Open the Code Editor • F7 • Select View Menu then Code option • Double Click on the Control you are writing the code for

  17. Comments • Provide Documentation & Explanations • Begin with a ‘ (followed by an * for readability)

  18. Event Code (Procedures) • GUI programs are Event Driven • Event Procedures respond to events • Writing an Event Procedure • Double click on control from Design Window • Select Control & Event from drop down windows in Code Editor

  19. Select the Control for the Event Procedure • Select the btnWelcome control from the Form Controls List Box

  20. Select the Event for the Event Procedure • Select the Click event from the list of many available events • Buttons have 57 possible events they can respond to

  21. Event Procedure Stub • Beginning of Procedure is created for you • If you create stub by double clicking on control it will create a stub for the most commonly used event

  22. Event Procedure • Write the code that you want executed when the user clicks on the btnWelcome button • Type: MsgBox (“Welcome to Visual Basic”) • Must be contained within the Event Procedure Stub

  23. Writing Visual Basic Code • Not Case Sensitive • Visual Basic will “correct” case issues for you • Keywords are in Blue • Special reserved words • Comments in Green • Problems with Syntax (Language) will be underlined in blue

  24. Create an Event Procedure • Create an Event Procedure for the btnExit button • Have it display “Goodbye” in a MsgBox • Then “End” – this will terminate the program

  25. Switching to Design Window • You can switch between the Design Window and the Code Window (once opened) by clicking on the tabs at the top of the Design and Code Windows • Form1.vb(Design) is the design window • Form1.vb is the Code Window

  26. Running the Application • Click the Run Icon on the Standard Toolbar • Press F5 • This will begin the program • Display the Form/Window • Nothing will happen • Waiting on an Event

  27. Event Driven Program • Click on the “Say Welcome” button • The message box should display • Click on the “Exit” button • The message box should display • The application should terminate

  28. Save the Project • Make sure to save your work • SAVE ALL (not Save Form) • Visual Basic applications are made of several files - Often even several forms

More Related