Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.

Similar presentations


Presentation on theme: "Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design."— Presentation transcript:

1 Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design

2 Visual Basic.NET Programming: From Problem Analysis to Program Design2 Objectives Explore the Visual Studio.NET development environment Create a project using Visual Basic.NET Compile and execute a Visual Basic.NET program Use the visual form designer Explore the debugging tool Explore the help facility

3 Visual Basic.NET Programming: From Problem Analysis to Program Design3 Exploring the Visual Studio.NET Development Environment Integrated Development Environment (IDE) –Set of software tools used for programming Visual Studio.NET can be used for –Visual Basic –Other programming languages

4 Visual Basic.NET Programming: From Problem Analysis to Program Design4 Getting Started with VB.NET Install Visual Studio.NET Start application

5 Visual Basic.NET Programming: From Problem Analysis to Program Design5 Exploring the Microsoft Development Environment MDE includes –Menu bar –Various toolbars –Several windows Context-sensitive –Toolbars are displayed to support the task you are performing

6 Visual Basic.NET Programming: From Problem Analysis to Program Design6

7 7 Exploring the Microsoft Development Environment (continued) Hidden windows –Enable you to keep frequently needed tools available without cluttering IDE –Reveal hidden window by moving mouse pointer over its tab Configure environment to match Figure 2-2

8 Visual Basic.NET Programming: From Problem Analysis to Program Design8

9 9 Understanding the Start Page Start Page –Automatically loads in document window –Contains three tabs named: Projects Online Resources My Profile Project –Collection of files related to a VB.NET application

10 Visual Basic.NET Programming: From Problem Analysis to Program Design10

11 Visual Basic.NET Programming: From Problem Analysis to Program Design11 Creating a Project Using Visual Basic.NET When creating a new project: –Must identify type of project as Visual Basic –Identify template –Specify project name and location Template: –Pattern for creating a specific type of application

12 Visual Basic.NET Programming: From Problem Analysis to Program Design12

13 Visual Basic.NET Programming: From Problem Analysis to Program Design13

14 Visual Basic.NET Programming: From Problem Analysis to Program Design14 Creating a Project Using Visual Basic.NET After creating project using New Project dialog box, displayed components are: –Module1.vb document VB.NET automatically generates some code –Solution Explorer window –Properties window Contains information about file properties

15 Visual Basic.NET Programming: From Problem Analysis to Program Design15 Understanding How VB.NET Organizes Your Programs Solution Explorer window –Shows hierarchical arrangement of items File names: –Use.vb extension –Named Module1.vb by default

16 Visual Basic.NET Programming: From Problem Analysis to Program Design16 Understanding How VB.NET Organizes Your Programs (continued) Solution –Container for one or more projects –Must designate startup project When solution contains more than one project Project that runs first

17 Visual Basic.NET Programming: From Problem Analysis to Program Design17 Using the Text Editor Provides standard text-editing capabilities Also provides: –Color-coding –Code indentation –Code completion Comment –Statement included for documentation purposes only

18 Visual Basic.NET Programming: From Problem Analysis to Program Design18 Using the Text Editor (continued) IntelliSense –Helps you complete lines of code by matching words –Recognizes partial class and method names Suggests possible matches for name you are typing

19 Visual Basic.NET Programming: From Problem Analysis to Program Design19

20 Visual Basic.NET Programming: From Problem Analysis to Program Design20 Modifying the Text Editor Settings Can change: –Font type –Font size –Color of text in code editor window

21 Visual Basic.NET Programming: From Problem Analysis to Program Design21 Renaming Module1.vb Assign descriptive names to programs you write –Should rename from default names Use Properties window to change name –Also rename module in source code

22 Visual Basic.NET Programming: From Problem Analysis to Program Design22 Setting the Startup Object Startup object –Module where execution begins when VB.NET runs application If module renamed: –Must modify startup object –Using Property Pages dialog box

23 Visual Basic.NET Programming: From Problem Analysis to Program Design23

24 Visual Basic.NET Programming: From Problem Analysis to Program Design24 Compiling And Executing a Visual Basic.NET Program Several ways to compile and execute: –Options on Build and Debug menus or toolbars –Shortcut key combinations –Matter or preference Select Debug on menu bar –Click Start Without Debugging –If there are errors: Message box displayed

25 Visual Basic.NET Programming: From Problem Analysis to Program Design25

26 Visual Basic.NET Programming: From Problem Analysis to Program Design26

27 Visual Basic.NET Programming: From Problem Analysis to Program Design27 Using the Visual Form Designer Windows application –Runs in Windows environment Visual form editor: –Windows Form Designer –Can select icons representing various components –Place and arrange components on window –Code is automatically written to match visual form

28 Visual Basic.NET Programming: From Problem Analysis to Program Design28 Creating a Windows Application Use Windows Application template Use Layout toolbar –To control appearance and position of components Form grid –Helps to layout components –Not visible when applications runs

29 Visual Basic.NET Programming: From Problem Analysis to Program Design29

30 Visual Basic.NET Programming: From Problem Analysis to Program Design30 Creating a Windows Application (continued) Handle –Use to resize objects –Pointer changes to double arrow –Resize form by clicking and dragging handle

31 Visual Basic.NET Programming: From Problem Analysis to Program Design31 Customizing the Appearance of a Form Modify form elements: –Size –Background color –Title –Name –Position

32 Visual Basic.NET Programming: From Problem Analysis to Program Design32

33 Visual Basic.NET Programming: From Problem Analysis to Program Design33

34 Visual Basic.NET Programming: From Problem Analysis to Program Design34

35 Visual Basic.NET Programming: From Problem Analysis to Program Design35

36 Visual Basic.NET Programming: From Problem Analysis to Program Design36 Adding Components to a Form Use Toolbox –Hidden window on left side of main window –Double-click toolbox items to add to form When adding buttons –Must identify action that will take place when button pressed

37 Visual Basic.NET Programming: From Problem Analysis to Program Design37

38 Visual Basic.NET Programming: From Problem Analysis to Program Design38

39 Visual Basic.NET Programming: From Problem Analysis to Program Design39 Exploring the Debugging Tool Debugger –Helps you isolate errors Breakpoint –Flag that tells debugger to temporarily suspend execution of program at a particular point –Can view information about program May help determine source of problem

40 Visual Basic.NET Programming: From Problem Analysis to Program Design40 Getting Started with the Debugger Debugger –Intended to help identify errors in program that occur while program is running –Cannot help to find coding errors that prevent program from being built successfully Syntax errors –Helps find logic errors HOWEVER does not fix them for you

41 Visual Basic.NET Programming: From Problem Analysis to Program Design41 Setting Breakpoints Position cursor in code window Right-click –Select Insert Breakpoint from popup menu Program execution is suspended just before line of code where breakpoint is set Execute program in debug mode

42 Visual Basic.NET Programming: From Problem Analysis to Program Design42

43 Visual Basic.NET Programming: From Problem Analysis to Program Design43

44 Visual Basic.NET Programming: From Problem Analysis to Program Design44 Exploring the Help Facility Help features: –Search for help on specific item –Browse table of contents –Scroll through alphabetized index of topics –Dynamic help –Context-sensitive help

45 Visual Basic.NET Programming: From Problem Analysis to Program Design45 Accessing Help Use Help menu Contents option: –List of help topics in table of contents format –Organizes help topics in hierarchical fashion Index option: –Displays list of help topics in alphabetical order Search option: –Search database of help pages

46 Visual Basic.NET Programming: From Problem Analysis to Program Design46 Accessing Help (continued) Dynamic Help option: –Identifies help topics in response to actions –Displays topics depending on currently selected window or item

47 Visual Basic.NET Programming: From Problem Analysis to Program Design47 Exploring Context-Sensitive Help Invoke by pressing F1 key Obtain help on virtually any –Keyword –Component –Window –Other element of VB.NET

48 Visual Basic.NET Programming: From Problem Analysis to Program Design48 Summary Visual Studio.NET –Integrated Development Environment (IDE) –Set of software tools that helps you code, debug, and test a system as you develop it –Provides many options that allow you to customize appearance of screen and the tools –Uses hierarchical arrangement of solutions and projects to organize programs

49 Visual Basic.NET Programming: From Problem Analysis to Program Design49 Summary (continued) The VB.NET text editor –Supports color-coding, indentation, and code completion features Compile and execute VB.NET program –Using options on Build and Debug menus Visual form editor –Visual development tool –Generates code from forms

50 Visual Basic.NET Programming: From Problem Analysis to Program Design50 Summary (continued) Debugger –Tool that helps identify problems Help facility of VB.NET provides many options for accessing help


Download ppt "Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design."

Similar presentations


Ads by Google