Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.

Similar presentations


Presentation on theme: "Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment."— Presentation transcript:

1 Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment

2 Object-Oriented Application Development Using VB.NET 2 Objectives In this chapter, you will: Explore the Visual Studio.NET development environment Create a project using Visual Basic.NET Compile and execute a VB.NET program Use the visual form designer Explore the debugging tool Explore the help facility

3 Object-Oriented Application Development Using VB.NET 3 Exploring the Visual Studio.NET Development Environment VB.NET is a language supported by Microsoft’s Visual Studio.NET integrated development environment Integrated development environment (IDE) helps programmers code, test, and document programs Valued Gateway Client:

4 Object-Oriented Application Development Using VB.NET 4 Exploring the Visual Studio.NET Development Environment Visual Studio.NET –Makes it easy to organize, compile, and execute programs –Provides facilities to help test programs and isolate errors –Provides help facilities

5 Object-Oriented Application Development Using VB.NET 5 Getting Started with VB.NET To start VB.NET in Windows XP Professional: –Click the Start button –Point to All Programs –Point to Microsoft Visual Studio.NET –Click Microsoft Visual Studio.NET The Microsoft Development Environment (MDE) window opens

6 Object-Oriented Application Development Using VB.NET 6 Getting Started with VB.NET

7 Object-Oriented Application Development Using VB.NET 7 Exploring the MDE MDE includes a menu bar, toolbars, and windows The menu bar is used to perform tasks such as: –Opening and closing files –Opening and closing projects –Compiling, executing, and debugging programs –Accessing help facilities

8 Object-Oriented Application Development Using VB.NET 8 Exploring the MDE Many toolbars are available in MDE Toolbars can be revealed or hidden MDE includes a number of windows, such as: –Document window –Solution Explorer window –Properties window

9 Object-Oriented Application Development Using VB.NET 9 Exploring the MDE Start Page appears as a tabbed page within a document window Tabs along the side of the screen identify hidden windows

10 Object-Oriented Application Development Using VB.NET 10 Understanding the Start Page Start Page contains a number of links to resources Clicking the Get Started link displays a list of recent projects –To open a project on the list, click the project name

11 Object-Oriented Application Development Using VB.NET 11 Understanding the Start Page The Get Started link also displays two buttons, Open Project and New Project: –Open Project button is clicked to work on a project not on the list of recent projects –New Project button is clicked to create a new project

12 Object-Oriented Application Development Using VB.NET 12 Understanding the Start Page

13 Object-Oriented Application Development Using VB.NET 13 Creating a Project Using VB.NET To create a VB.NET project, identify: –Type of project –Template to use –Project name and location To create a Visual Basic project, project type must be Visual Basic A template is a pattern for creating a specific type of application

14 Object-Oriented Application Development Using VB.NET 14 Understanding the Way VB.NET Organizes Your Programs Solution Explorer window shows hierarchical arrangement of items that make up the solution In VB.NET, programs are named with a.vb file extension By default, VB.NET names programs as Module1.vb, Module2.vb, and so on More descriptive names can be assigned by programmer

15 Object-Oriented Application Development Using VB.NET 15 Understanding the Way VB.NET Organizes Your Programs A project is a mechanism for grouping related files, for example: –Program files –Image files –Other miscellaneous items A solution is a container for one or more projects –Solution file appears at the top of the hierarchy in Solution Explorer window

16 Object-Oriented Application Development Using VB.NET 16 Understanding the Way VB.NET Organizes Your Programs If a solution contains more than one project, the startup project must be designated Startup project is the project that will be executed first

17 Object-Oriented Application Development Using VB.NET 17 Using the Text Editor Visual Studio.NET text editor provides: –Standard text editing capabilities –Color-coding feature –Code indentation feature –Code completion feature

18 Object-Oriented Application Development Using VB.NET 18 Renaming Module1.vb Descriptive names should be assigned to programs By default, VB.NET names programs as Module1.vb, Module2.vb, and so on File Name property in Properties window is used to rename programs

19 Object-Oriented Application Development Using VB.NET 19 Setting the Startup Object After changing the module name within the source code, project properties must be changed to identify the new name as the startup object Startup object is the module where execution begins

20 Object-Oriented Application Development Using VB.NET 20 Compiling and Executing a VB.NET Program A program can be compiled and executed using: –Options on Build and Debug menus or toolbars –Shortcut key combinations To compile and execute a program using menu options: –Click Debug on menu bar –Click Start Without Debugging

21 Object-Oriented Application Development Using VB.NET 21 Using the Visual Form Designer A Windows application is one that runs in the Windows environment When creating Windows applications, a visual form editor can be used In a visual editor: –Programmer places icons representing various components on the screen –VB.NET generates required programming statements

22 Object-Oriented Application Development Using VB.NET 22 Using the Visual Form Designer The visual form editor in MDE is Windows Forms Designer Toolbox contains visual components Elements can be selected from Toolbox to dynamically design forms Properties window is used to adjust properties of components on the form

23 Object-Oriented Application Development Using VB.NET 23 Creating a Windows Application In a Windows application, Windows Forms Designer can be used to create an input form In a new Windows application, Windows Forms Designer appears as a tabbed document labeled Form1.vb [Design]

24 Object-Oriented Application Development Using VB.NET 24 Creating a Windows Application Properties window shows properties of a form that is open Background of the form shows a grid to help align components Along the outer edges of the form are handles used to resize the form

25 Object-Oriented Application Development Using VB.NET 25 Creating a Windows Application

26 Object-Oriented Application Development Using VB.NET 26 Customizing the Appearance of a Form Size of the form can be changed using the handles along its outer edges

27 Object-Oriented Application Development Using VB.NET 27 Customizing the Appearance of a Form To change title of the form, use Text property in Properties window

28 Object-Oriented Application Development Using VB.NET 28 Customizing the Appearance of a Form To change background color of the form, use BackColor property in Properties window

29 Object-Oriented Application Development Using VB.NET 29 Adding Components to a Form Toolbox contains components which can be added to a form

30 Object-Oriented Application Development Using VB.NET 30 Adding Components to a Form To add a message to a form, use Label component Color of label text is changed using ForeColor property in Properties window

31 Object-Oriented Application Development Using VB.NET 31 Adding Components to a Form To change label font, use Font property in Properties window

32 Object-Oriented Application Development Using VB.NET 32 Adding Components to a Form To center label text within the area occupied by label, use TextAlign property in Properties window

33 Object-Oriented Application Development Using VB.NET 33 Adding Components to a Form To add a button to the form, double-click Button component of Toolbox A button’s appearance can be changed by using Properties window Text editor can be used to add code to make a button work

34 Object-Oriented Application Development Using VB.NET 34 Adding Components to a Form

35 Object-Oriented Application Development Using VB.NET 35 Exploring the Debugging Tools A debugger helps isolate errors that keep a program from running as intended A debugger can be used to set breakpoints A breakpoint is a flag that tells the debugger to temporarily suspend execution of program at a particular point

36 Object-Oriented Application Development Using VB.NET 36 Getting Started with the Debugger Debugger is used to identify errors in the program that occur while the program is running Debugger cannot find coding errors that prevent the program from being built successfully

37 Object-Oriented Application Development Using VB.NET 37 Setting Breakpoints To set a breakpoint: –In code window, right-click statement –Click Insert Breakpoint on shortcut menu

38 Object-Oriented Application Development Using VB.NET 38 Exploring the Help Facility In VB.NET development environment, programmer can: –Search for help on a specific item –Browse a table of contents –Scroll through an alphabetized index of topics VB.NET also includes: –Dynamic help –Context-sensitive help

39 Object-Oriented Application Development Using VB.NET 39 Accessing Help Most help features can be accessed through options on Help menu

40 Object-Oriented Application Development Using VB.NET 40 Accessing Help On Help menu: –Contents option displays a list of help topics in a format resembling a table of contents –Index option displays a list of help topics in alphabetical order –Search option allows programmer to search the database of help pages –Dynamic Help option dynamically identifies help topics in response to actions taken by programmer

41 Object-Oriented Application Development Using VB.NET 41 Exploring Context-Sensitive Help Context-sensitive help can be invoked by pressing the F1 key F1 key can be pressed to obtain help on virtually any keyword, component, window, or other element of VB.NET

42 Object-Oriented Application Development Using VB.NET 42 Summary Visual Studio.NET is an integrated development environment (IDE) An IDE is a set of software tools that helps you code, debug, and test a system as you develop it Visual Basic.NET is a programming language supported by Visual Studio.NET IDE VB.NET text editor supports color-coding, indentation, and code completion features Windows Forms Designer is a visual development tool that generates code from icons

43 Object-Oriented Application Development Using VB.NET 43 Summary VB.NET uses a hierarchical arrangement of solutions and projects A debugger is a tool that helps identify problems that prevent a program from running as intended A breakpoint is a flag that instructs debugger to temporarily suspend execution of a program Help facilities of VB.NET include Contents window, Index window, Search window, Dynamic Help, and context-sensitive help


Download ppt "Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment."

Similar presentations


Ads by Google