Shows how to build and execute complete applications from start to finish.
Includes 31 tutorials and 100+ exercises based on real-world applications.
Invites students into the text and keeps them reading.
Code is colored similar to the way it appears in Visual Studio .NET.
Draws students attention to featured program segments.
Provides easy reference in every sample program.
Allows students to see the effects of their programming, firsthand.
Shows students screen captures on the page exactly as they appear on their computer screens.
Draws students' attention to the nuances that make programming easier or that often trip up novices.
Makes the text inviting and accessible to students regardless of their preferred learning styles.
Allows students to gain practice reading the types of diagrams used in industry.
Ensures that students gain fluency in the language necessary for professional-level programming.
Gives students the opportunity to test their understanding of concepts and procedures and receive feedback on their progress.
Makes it easy for students to find exactly the information for which they are looking.
Simply Visual Basic .NET leverages .NET's true powernot just adapted Visual Basic 6 techniques. Its out-standing pedagogical approach comes from Deitel & Associatesthe best-selling programming language authors and renowned instructors who have taught programming to over 1,000,000 people in 100+ countries.
APPLICATION-DRIVEN, step-by-step tutorial approachThe Deitels explore core Visual Basic .NET concepts in the context of interesting, real-world applications such as: Web-Based Bookstore ATM Automated Phone Directory Billing Car Payments Check Writer Craps Game Flag Quiz Fundraiser Graphics Painter Inventory Investment Interest Microwave Oven Payroll Sales Data Screen Scraper Security Panel Shipping Hub Ticket Ordering Typing Application
Key Topics include Visual Studio® .NET IDE Visual Programming Framework Class Library (FCL) Controls (Buttons, TextBoxes, ListBoxes, Microsoft Chart, Timers, ComboBoxes, RadioButtons, Menus, Dialogs and others) Event Handling Debugger Algorithms Pseudocode UML Control Structures Methods Random Number Generation Arrays Classes Objects Collections Mouse & Keyboard Event Handling Strings Sequential-Access Files Database Graphics Multimedia GUI Design Web Application Development
1. Graphing Application.
Introducing Computers, the Internet and Visual Basic .NET.
Introducing the Visual Studio .NET IDE.
Introduction to Visual Programming.
Introducing TextBoxes and Buttons.
Introducing Variables, Memory Concepts and Arithmetic.
Introducing Algorithms, Pseudocode and Program Control.
Introducing CheckBoxes and Message Dialogs.
Introducing the Do While...Loop and Do Until...Loop Repetition Statements.
Introducing the Do...Loop While and Do Loop...Until Repetition Statements.
Introducing the For...Next Repetition Statement.
Introducing the Select Case Multiple-Selection Statement.
Introducing Function Procedures and Sub Procedures.
Using Dates and Timers.
Introducing Scope, Pass-by-Reference and Option Strict.
Introducing Random-Number Generation.
Introducing One-Dimensional Arrays and Combo Boxes.
Introducing Two-Dimensional Arrays, RadioButtons and the MSChart Control.
Building Your Own Classes and Objects.
Introducing Collections, the For Each...Next Statement and Access Keys.
Introducing the Graphics Object and Mouse Events.
Introducing Keyboard Events, Menus and Dialogs.
Introducing String Processing.
Introducing Sequential-Access Files.
Introducing Database Programming.
Introducing Graphics and Printing.
Introducing Multimedia Using Microsoft Agent.
Introducing Internet Information Services.
Introducing Web Controls.
Examining the Database and Creating Database Components.
Introducing Code-Behind Files.
Welcome to Visual Basic .NET and the world of Windows, Internet and World-Wide-Web programming with Visual Studio and the .NET platform! This book, the first in our new Simply series, was a joy to create. Our goal was to write a book that focuses on core concepts and features of Visual Basic .NET while keeping the discussion of this highly technical subject as simple as possible.
To achieve these goals, we implemented an innovative teaching methodology. We present the core concepts of leading-edge computing technologies using the tutorial-based, APPLICATION -DRIVEN approach, combined with the DEITEL signature LIVE-CO/DE approach of teaching programming using complete, working, real-world applications. We merged the notion of a lab manual with that of a conventional textbook, creating a book that is best used by students sitting at computers and building each example application as they read the tutorials.
As students work through the tutorials, they learn about Visual Basic .NET and its fundamental features, such as visual programming concepts, graphical-user-interface (GUI) components, multimedia (audio, images, animation and video), file processing, database processing and Internet and World-Wide-Web-based client/server networking. At the end of most sections, we provide self-review questions with answers so that students receive immediate feedback on their understanding of the material. Hundreds of additional self-review questions with answers are available on this book's Companion Web Site.
This book is loaded with pedagogic features, including:
Focus of the Book
Our goal was clear: Produce a Visual Basic .NET textbook for introductory-level courses in computer programming aimed at students with little or no programming experience. This book teaches computer programming principles and the Visual Basic .NET language, including data types, control structures, object-oriented programming, Visual Basic .NET classes, GUI concepts, event-driven programming and more. After mastering the material in this book, students will be able to program in Visual Basic.NET and to employ many key capabilities of the .NET platform.
To install some of the required software for this book, students and instructors will need Administrator-level access to the computer. For university computer labs where students do not have Administrator-level access, instructors and system administrators must ensure that the proper software is installed on the lab computers. In Tutorial 27, certain Microsoft Agent software components must be installed to execute and develop the Phone Book application. If students are not allowed to install software on lab computers, the Microsoft Agent components discussed in Tutorial 27 must be installed in advance. To configure and execute some of the examples and exercises, such as the Bookstore case study in Tutorials 28-31, students will need to have Administrator-level access. In addition, the examples in the book require that students have Debugger or Administrator access to the computer, which is typically required to develop applications in Visual Studio .NET.
A Note Regarding Terminology Used in the Book
In Tutorial 13, we discuss methods as Sub procedures (sometimes called subroutines) and Function procedures (sometimes called functions). We use this terminology .for two reasons. First, the keywords Sub and Function are used in procedure definitions, so this naming is logical for students. Second, Visual Basic professionals have used this terminology for years and will continue to do so in the future. We also use the term "function" at certain points in this text to refer to Visual Basic 6 Function procedures that remain in Visual Basic.NET (such as Val and Pmt). When we introduce object-oriented programming concepts in Tutorial 19, we discuss the difference between procedures and methods and indicate that the procedures defined throughout the text are, in fact, methods. We hope our use of terminology helps you present the material in a simple and understandable manner.
Exception Handling: Bonus Tutorial Available Online
Exception Handling is one of the most important topics in Visual Basic .NET for building mission-critical and business-critical applications. Programmers need to know how to recognize the exceptions (errors) that could occur in software components and handle those exceptions effectively, allowing programs to deal with problems and continue executing instead of "crashing." This tutorial overviews the proper use of exception handling, including the termination model of exception handling, throwing and catching exceptions and the library class Exception. To download this tutorial, please go to www.deitel.com.
Each tutorial begins with objectives that inform students of what to expect and give them an opportunity, after reading the tutorial, to determine whether they have met the intended goals.
The tutorial outline enables students to approach the material in top-down fashion. Along with the tutorial objectives, the outline helps students anticipate future topics and set a comfortable and effective learning pace.
Example Programs (with Program Outputs)
We present Visual Basic .NET features in the context of complete, working Visual Basic .NET programs. We call this our LIVE-CODE approach. All examples are available on the CD that accompanies the book or as downloads from our Web site, www.deitel.com.
An abundance of charts, line drawings and program outputs are included. The discussion of control structures, for example, features carefully drawn UML activity diagrams. Note: We do not teach UML diagramming as a program-development tool, but we do use UML diagrams to explain the precise operation of many of Visual Basic .NET'S control structures.
Hundreds of programming tips to help students focus on important aspects of program development. These tips and practices represent the best the authors have gleaned from a combined seven decades of programming and teaching experience.
Each tutorial includes a bullet-list-style summary of the new programming concepts presented. This reinforces key actions taken to build the application in each tutorial.
Each tutorial includes a list of important terms defined in the tutorial. These terms also appear in the index and in a book-wide glossary, so the student can locate terms and their definitions quickly.
230 Self-Review Questions and Answers
Self-review multiple-choice questions and answers are included after most sections to build students' confidence with the material and prepare them for the regular exercises. Students should be encouraged to attempt all the self-review exercises and check their answers.
834 Exercises (Solutions in Instructor's Manual)
Each tutorial concludes with exercises. Typical exercises include 10 multiple-choice questions, a "What does this code do?" exercise, a "What's wrong with this code?" exercise and a programming challenge. The questions involve simple recall of important terminology and concepts, writing individual Visual Basic .NET statements, writing small portions of Visual Basic.NET applications and writing complete Visual Basic .NET methods, classes and applications. Every programming exercise uses a step-by-step methodology to suggest how to solve the problems. The solutions for the exercises are available only to instructors through their Prentice-Hall representatives. NOTE: Please do not write to us requesting the instructor's manual. Distribution of this publication is strictly limited to instructors teaching from the book. Instructors may obtain the solutions manual only from their regular Prentice Hall representatives. We regret that we cannot provide the solutions to professionals.
GUI Design Guidelines
Consistent and proper graphical user interface design is crucial to visual programming. In each tutorial, we summarize the GUI design guidelines that were introduced. Appendix C, presents a cumulative list of these GUI design guidelines for easy reference.
Controls, Events, Properties & Methods Summaries
Each tutorial includes a summary of the controls, events, properties and methods covered in the tutorial. The summary includes a picture of each control, shows the control "in action" and lists the control's properties, events and methods that were discussed up to and including that tutorial. In addition, Appendix E groups the controls by tutorial for easy reference.
The extensive index includes important terms both under main headings and as separate entries so that students can search for any term or concept by keyword. The code examples and the exercises also are included in the index. For every Visual Basic .NET source-code program in the book, we indexed it both under the appropriate application and as a subindex item under "code examples." We have also double-indexed features such as controls and properties. This makes it easier to find examples using particular features.
Simply Visual Basic .NET is accompanied by extensive ancillary materials for instructors, including the following:
Companion Web Site
For instructors, the Companion Web Site offers a Syllabus Manager, which helps instructors plan courses interactively and create online syllabi. Students also benefit from the functionality of the Companion Web Site. Book-specific resources for students include:
For the second edition of Simply Visual Basic.NET, we are planning to include the Simply Visual Basic .NET. An APPLICATION-DRIVEN, Tutorial Approach Multimedia Cyber Classroom interactive CD. Our Cyber Classrooms are loaded with e-Learning features that are ideal for both learning and reference.
Each Cyber Classroom CD provides an introduction in which the authors overview the Cyber Classroom's features. The textbook's LIVE-CODE examples truly "come alive" in the Cyber Classrooms. If you are viewing a program and want to execute it, you just click the lightning-bolt icon, and the program will run. You will seeand hear, when working with audio-based multimedia programsthe program's outputs immediately. If you want to modify a program and see the effects of your changes, click the floppy-disk icon that causes the source code to be "lifted off" the CD and "dropped into" one of your own directories so you can edit the text, recompile the program and try out your new version. Click the audio icon, and one of the authors will discuss the program and "walk you through" the code.
The Cyber Classrooms also provide navigational aids, including extensive hyperlinking. The Cyber Classrooms are browser based, so they remember sections that you have visited recently and allows you to move forward or backward among them. The thousands of index entries are hyperlinked to their text occurrences. Furthermore, when you key in a term using the "find" feature, the Cyber Classrooms locate occurrences of that term throughout the text. The Table of Contents entries are "hot," so clicking a tutorial name takes you immediately to that tutorial.
Selected content from Simply Visual Basic. NET and other Deitel texts, is available to integrate into various Course Management Systems, including CourseCompass, Blackboard and WebCT. Course Management Systems help faculty create, manage and use sophisticated Webbased educational tools and programs. Blackboard, CourseCompass and WebCT offer:
In addition to the tools found in Blackboard and WebCT, CourseCompass from Prentice Hall includes:
Premium Course Management Systems
For the second edition of Simply Visual Basic .NET, we are planning support for Premium Course Management Systems that integrate content from a rich variety of sources, including Deitel books, Cyber Classrooms and Companion Web Sites with Course Management coursewareproviding enhanced content to users. Premium Course Management Systems include:
To view free online demonstrations and learn more about Course Management Systems that support Deitel content, visit the following Web sites:
Please follow the instructions in this section to ensure that you have the proper setup before you begin this book.
Font and Naming Conventions
We use fonts to distinguish between IDE features (such as menu names and menu items) and other elements that appear in the IDE. Our convention is to emphasize IDE features in a sans-serif bold Helvetica font (for example, Properties window) and to emphasize program text in a serif Luci da font (for example, Di m x As Boolean). We use italics to emphasize special terms that are associated with Visual Studio .NET features, such as Intellisense and Parameter Info.
In the college bookstores, this book is shrink-wrapped with a trial edition of the Microsoft® Visual Studio® .NET integrated development environment. This is a full and complete version of Visual Studio .NET which may be used without charge for 60 days, at which time it becomes inoperable. No technical support accompanies this edition.
Students-enrolled in a course at an accredited school who have purchased this book for use in conjunction with that course may purchase Microsoft Visual Basic .NET Standard Edition from Microsoft for $15.00 (US) plus shipping and handling. The standard edition is fully functional and is shipped on 5 CDs. There is no time limit and technical support is available upon registration of the software after installation.
To purchase this software, you must obtain a purchase code from your instructor. This code is supplied to your instructor by Prentice Hall. To order Visual Basic .NET Standard Edition, visit
and follow the instructions. A credit card is required to complete the purchase. Professionals can obtain the 60-day trial edition of Visual Studio .NET from
To install and run Visual Basic .NET, Microsoft recommends that PCs have these minimum requirements:
This book assumes that you are using Windows 2000 or Windows XP, plus Microsoft's Internet Information Services (IIS). Additional setup instructions for Web servers and other software is available on our Web site along with the examples. Note: This is copyrighted material. Feel free to use it as you study, but you may not republish any portion of it in any form without explicit permission from Prentice Hall and the authors.
Simply Visual Basic .NET includes hundreds of screenshots of applications. Your monitor-display settings may need to be adjusted so that the screenshots in the book will match what you see on your computer screen as you develop each application. Note: We refer to single-clicking with the left mouse button as selecting, or clicking. We refer to double-clicking with the left mouse button simply as double clicking. Follow these steps to set your monitor display correctly:
If you choose to use different settings, the Size and Location values we provide for different GUI elements (such as Buttons and Labels) in each application might not appear correctly on your screen. If so, simply adjust Size and Location values so the GUI elements in your application appear similar to those in the screenshots in the book.
If you are using Windows XP, we assume that your theme is set to Windows Classic Style. Follow these steps to set Windows XP to display the Windows Classic theme:
All of the examples for Simply Visual Basic.NET are included on the CD-ROM that accompanies this textbook. Follow the steps in the box, Copying the Book Examples from the CD-ROM, to copy the examples folder from the CD-ROM onto your hard drive. We suggest that you work from your hard drive rather than your CD drive for two reasons: you cannot save your programs to the book's CD (the CD is read-only), and files can be accessed faster from a hard drive than from a CD. The examples from the book (and our other publications) are also available on the Internet as downloads from the following Web sites:
Screen shots in the box, Copying the Book Examples from the CD-ROM, might differ slightly from what you see on your computer, depending on whether you are using Windows 2000 or Windows XP We used Windows 2000 to prepare the screenshots for this book.