1 / 27

An Overview of Visual Basic .NET

An Overview of Visual Basic .NET. Methods of Programming. Procedural Languages Constructed as a set of procedures (operational, functional units) Often used in text-based environments Object-Oriented Constructed as a set of objects

saad
Download Presentation

An Overview of Visual Basic .NET

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. An Overview of Visual Basic .NET

  2. Methods of Programming • Procedural Languages • Constructed as a set of procedures (operational, functional units) • Often used in text-based environments • Object-Oriented • Constructed as a set of objects • Objects have data elements (i.e. properties) and perform actions (i.e. methods)

  3. Object-Oriented/Event-Driven Languages • Simplifies the task of programming GUI applications. • In object-oriented/event-driven languages, the emphasis of a program is on the objects included in the user interface (such as scroll bars and buttons) and the events (such as scrolling and clicking) that occur when those objects are used

  4. OOP Terminology • OOP is an acronym for object-oriented programming • It means that you are using an object-oriented language to create a program that contains one or more objects • OOD is an acronym for object-oriented design • Like top-down design, which is used to plan procedure-oriented programs, OOD is also a design methodology, but it is used to plan object-oriented programs • OOD divides a problem into one or more objects

  5. Object An Object: • Is Anything that can be seen or touched • Has attributes (properties) that describe it • Has behaviors(events) that the object can either perform or have performed on it

  6. Types of ControlsCh1\Program2 on p.10(This application can be found in the student data files)

  7. Starting and Customizing Visual Studio .NET • Visual Studio .NET is Microsoft’s newest integrated development environment (IDE) • Includes programming languages such as Visual Basic .NET, C++ .NET, C# .NET and J# • Can Create: • A Windows-based application has a Windows user interface and runs on a desktop computer • A console application • A Web-based application, on the other hand, has a Web user interface and runs on a server

  8. .NET FrameworkNew Concepts • Common Language Runtime (CLR) • Execution engine • Memory management • Intermediate Language (IL) • VB.NET compiles to IL • Just-in-time compilation

  9. Language Interoperability .NET: Type SystemStandard C# VB.NET

  10. The Programming Process(1.5) The Programming Process Consists of Several Steps, Which Include Design, Creation, Testing, and Debugging Activities

  11. Example of an Object • This is a GUI object • Data includes number-of-hours-worked, hourly-pay-rate, and gross-pay-earned • Action is to calculate and display gross-pay- earned, given number-of-hours-worked and hourly-pay-rate

  12. Step 1 of Developing an Application • Clearly define what the program is to do • For example: • Purpose: To calculate the user’s gross pay • Input: Number of hours worked, hourly pay rate • Process: Multiply number of hours worked by hourly pay rate (The result is the user’s gross pay) • Output: Display a message indicating the user’s gross pay

  13. Step 2 of Developing an Application • Visualize the application running on the computer and design its user interface

  14. Step 3 of Developing an Application • Make a list of the controls needed • Partial list: TypeNameDescription TextBox txtHoursWorked Allows the user to enter the number of hours worked. TextBox txtPayRate Allows the user to enter the hourly pay rate Label lblGrossPay Displays the gross pay, after the btnCalcGrossPay button has been clicked Button btnCalcGrossPay When clicked, multiplies the number of hours worked by the hourly pay rate Button btnClose When clicked, terminates the application

  15. Step 4 of Developing an Application • Define the Values of Each Control's Relevant Properties: Control TypeControl NameText Form (Default) "Wage Calculator" Label (Default) "Number of Hours Worked" Label (Default) "Hourly Pay Rate" Label (Default) "Gross Pay Earned" Label lblGrossPay "$0.00" TextBox txtHoursWorked "" TextBox txtPayRate "" Button btnCalcGrossPay "Calculate Gross Pay" Button btnClose "Close"

  16. Step 5 of Developing an Application • Make a list of methods needed for each control: MethodDescription btnCalcGrossPay_ClickMultiplies the number of hours worked by the hourly pay rate Thesevalues are entered into the txtHoursWorked and txt-PayRate TextBoxes The result is stored in the lblGrossPay Text property btnClose_Click Terminates the application

  17. Step 6 of Developing an Application • Create a pseudocode version of each method: • Pseudocode is a combination of English and a programming language • For this application:Store Number of Hours Worked times Hourly Pay Rate in grossPay.Store the value in grossPay in lblGrossPay.Text.

  18. Step 7 of Developing an Application • Check the code for errors: • Go step by step through the code, running it in your head as though the computer is running it • Keep track of where in the code is being executed • Keep track of the values of all of the variables

  19. Step 8 of Developing an Application • Use Visual Basic .NET to create the forms and other controls identified in step 3 • This is the first use of Visual Basic .NET, all of the previous steps have just been on paper

  20. Step 9 of Developing an Application • Use Visual Basic .NET to write the code for the event procedures and other methods created in step 6 • This is the second step on the computer

  21. Step 10 of Developing an Application • Attempt to run the application - find syntax errors • Correct any syntax errors found and repeat this step as often as necessary • All of the syntax errors must be removed before Visual Basic .NET will create a program that you can actually run on the computer

  22. Step 11 of Developing an Application • Run the application - once all syntax errors are fixed • Run the program with a variety of test data • Check the results to be sure that they are correct • Correct any errors found • Repeat steps 10 and 11 as many times as necessary

  23. Visual Studio .NET Recent Projects Solution Explorer Dynamic Help Toolbox

  24. Starting a New Project Installed .NET Products Type of Project Name of Project Name and Location Of Project

  25. Toolbox (auto-hidden) Visual Basic .NET Project information Windows Form object Properties window

  26. The Visual Basic .NET Environment • Design Window • Solution Explorer Window • Dynamic Help Window • Properties Window • Docked and Floating Windows • Toolbox

More Related