Mastering Microsoft Visual Basic 2010
All the books in the Sybex Mastering series feature comprehensive and expert coverage of topics you can put to immediate use. Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file. Evangelos Petroutsos is a computer engineer who has worked for the California Institute of Technology and MCI. Currently, he writes computer books and articles, teaches networking and programming courses, and works as a computer communications consultant. He is the author of the Sybex titles Mastering Microsoft Visual Basic 2008 and Mastering Microsoft Visual Basic 2005, among other books.
Mastering Microsoft Visual Basic 2010
Welcome to Microsoft's Visual Basic 2010, another milestone version of the most popular programming language for building Windows and web applications. In modern software development, however, the language is only one of the components we use to build applications. The most important component is the .NET Framework, which is an indispensable component of every application; it's actually more important than the language itself. You can think of the Framework as an enormous collection of functions for just about any programming task. All drawing methods, for example, are part of the System.Drawing class. To draw a rectangle, you call the DrawRectangle method of the System.Drawing class, passing the appropriate arguments. To create a new folder, you call the CreateDirectory method of the Directory class, and to retrieve the files in a folder, you call the GetFiles method of the same class.
The Framework contains all the functionality of the operating system and makes it available to your application through methods. Methods are very similar to functions, which extend the basic capabilities of a language. The Framework is a huge collection of such methods, organized in units according to their role and in a way that makes it fairly easy to locate the methods for the task at hand. The language and the Framework are the two "programming" components absolutely necessary to build Windows applications. It's possible to develop applications with these two components alone, but the process would be awfully slow.
The software development process relies on numerous tools that streamline the coding experience. The third component is an integrated environment that hosts those tools, enabling you to perform many common tasks with point-and-click operations. It's basically an environment in which you can design your forms with visual tools and write code as well. This environment, provided by Visual Studio, is known as an integrated development environment, or IDE. You'll be amazed by the functionality provided by the tools of Visual Studio: you can actually design a functional data-driven application without writing a single line of code. You can use similar tools in the same environment to design a fancy data-driven web page without a single line of code. Visual Studio even provides tools for manipulating databases and allows you to switch between tasks, all in the same, streamlined environment. You realize, of course, that Visual Studio isn't about writing applications without code; it just simplifies certain tasks through wizards, and more often than not, we step in and provide custom code to write a functional application. Even so, Visual Studio provides numerous tools, from debugging tools that help you track and fix all kinds of bugs in your code to database-manipulation tools and deployment wizards that streamline the process of deploying applications.
This book shows you how to use Visual Studio 2010 and Visual Basic 2010 to design rich Windows and web applications. We'll start with the visual tools and then we'll explore Visual Basic and the Framework. A Windows application consists of a visual interface and code behind the elements of the interface. (The code handles the user actions on the visual interface, such as the click of a button, the selection of a menu item, and so on.) You'll use the tools of Visual Studio to build the visual interface, and then you'll program the elements of the application with Visual Basic. For any nontrivial processing, such as file and folder manipulation, data storage, and so on, you'll use the appropriate classes of the .NET Framework. A substantial segment of this book deals with the most useful components of the Framework. We will also explore databases and data-driven applications, which are the most common type of business applications. Finally, we'll go through the basics of web programming. You'll l