Beginning Visual Basic 2005 Express Edit - Wright_ Peter.pdf

(20749 KB) Pobierz
374578073 UNPDF
THE EXPERT’S VOICE ® IN .NET
Includes Microsoft
Visual Basic 2005
Express Edition
Beginning
Visual Basic 2005
From Novice to Professional
Peter Wright
Express Edition
374578073.040.png 374578073.051.png 374578073.059.png 374578073.070.png 374578073.001.png 374578073.002.png 374578073.003.png 374578073.004.png 374578073.005.png 374578073.006.png 374578073.007.png 374578073.008.png 374578073.009.png 374578073.010.png 374578073.011.png 374578073.012.png 374578073.013.png 374578073.014.png 374578073.015.png 374578073.016.png 374578073.017.png 374578073.018.png 374578073.019.png 374578073.020.png 374578073.021.png 374578073.022.png 374578073.023.png 374578073.024.png
 
374578073.025.png
 
374578073.026.png
 
374578073.027.png
 
374578073.028.png
 
374578073.029.png 374578073.030.png 374578073.031.png 374578073.032.png 374578073.033.png 374578073.034.png 374578073.035.png 374578073.036.png 374578073.037.png 374578073.038.png 374578073.039.png
 
374578073.041.png 374578073.042.png 374578073.043.png 374578073.044.png 374578073.045.png 374578073.046.png 374578073.047.png 374578073.048.png 374578073.049.png 374578073.050.png 374578073.052.png 374578073.053.png 374578073.054.png 374578073.055.png 374578073.056.png 374578073.057.png 374578073.058.png 374578073.060.png 374578073.061.png 374578073.062.png 374578073.063.png 374578073.064.png 374578073.065.png 374578073.066.png
Beginning Visual Basic
2005 Express Edition
From Novice to Professional
■■■
Peter Wright
374578073.067.png 374578073.068.png
Beginning Visual Basic 2005 Express Edition: From Novice to Professional
Copyright © 2006 by Peter Wright
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-59059-622-7
ISBN-10 (pbk): 1-59059-622-6
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Lead Editor: Jim Sumser
Technical Reviewer: Jason Bock
Editorial Board: Steve Anglin, Ewan Buckingham, Gary Cornell, Jason Gilmore, Jonathan Gennick,
Jonathan Hassell, James Huddleston, Chris Mills, Matthew Moodie, Dominic Shakeshaft, Jim Sumser,
Keir Thomas, Matt Wade
Associate Publisher, Production Director, and Project Manager: Grace Wong
Copy Edit Manager: Nicole LeClerc
Copy Editors: Sharon Wilkey, Ami Knox
Assistant Production Director: Kari Brooks-Copony
Senior Production Editor: Laura Cheu
Compositor: Pat Christenson
Proofreader: Nancy Riddiough
Indexer: Broccoli Information Management
Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com , or
visit http://www.springeronline.com .
For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA
94710. Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com , or visit http://www.apress.com .
The information in this book is distributed on an “as is” basis, without warranty. Although every precaution
has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to
any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly
by the information contained in this work.
The source code for this book is available to readers at http://www.apress.com in the Source Code section.
You will need to answer questions pertaining to this book in order to successfully download the code.
374578073.069.png
Contents at a Glance
About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xi
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
CHAPTER 1 Welcome to Visual Basic Express . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
CHAPTER 2 The Basics of Visual Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
CHAPTER 3 Working with Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
CHAPTER 4 Classes and Object Orientation in Visual Basic 2005 . . . . . . . . . . . . 93
CHAPTER 5 More-Advanced Object Orientation . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
CHAPTER 6 Handling Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
CHAPTER 7 How Visual Basic 2005 Express Helps You Code . . . . . . . . . . . . . . 171
CHAPTER 8 Building Windows Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
CHAPTER 9 Windows and Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
CHAPTER 10 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
CHAPTER 11 Menus and Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
CHAPTER 12 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
CHAPTER 13 Lists and Generics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
CHAPTER 14 Files and Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
CHAPTER 15 Working with XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
CHAPTER 16 Database Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
CHAPTER 17 The Internet and Visual Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
CHAPTER 18 Threading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
CHAPTER 19 Where to Now? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
iii
374578073.071.png
374578073.072.png
Zgłoś jeśli naruszono regulamin