ebook img

Starting out with Visual Basic PDF

2060 Pages·2016·31.457 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Starting out with Visual Basic

® Starting Out With Visual Basic Seventh Edition ® Starting Out With Visual Basic Seventh Edition Tony Gaddis Haywood Community College Kip Irvine Florida International University Boston  Columbus  Indianapolis  New York  San Francisco  Hoboken Amsterdam  Cape Town  Dubai  London  Madrid  Milan Munich  Paris   Montréal  Toronto Delhi  Mexico City  São Paulo  Sydney  Hong Kong  Seoul  Singapore  Taipei   Tokyo Vice President, Editorial Director, ECS: Marcia Horton Acquisitions Editor: Matt Goldstein Editorial Assistant: Kristy Alaura Vice President of Marketing: Christy Lesko Director of Field Marketing: Tim Galligan Product Marketing Manager: Bram Van Kempen Field Marketing Manager: Demetrius Hall Marketing Assistant: Jon Bryant Director of Product Management: Erin Gregg Team Lead, Program and Project Management: Scott Disanno Program Manager: Carole Snyder Project Manager: Greg Dulles Senior Specialist, Program Planning and Support: Maura Zaldivar-Garcia Cover Designer: Joyce Cosentino Wells Manager, Rights and Permissions: Rachel Youdelman Project Manager, Rights and Permissions: William Opaluch Cover Image: Stargatechris/123RF Inventory Manager: Meredith Maresca Media Project Manager: Renata Butera ® Full-Service Project Manager: Jogender Taneja/iEnergizer Aptara , Inc. ® Composition: iEnergizer Aptara , Inc. Printer/Binder: Edwards Brothers, Inc. Cover Printer: Phoenix Color Credits and acknowledgments borrowed from other sources and reproduced, with permission, in this textbook appear on the Credits page at the end of the text. Copyright © 2017, 2014, 2011 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by Copyright, and permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, request forms and the appropriate contacts within the Pearson Education Global Rights & Permissions department, please visit www.pearsoned.com/permissions/. Many of the designations by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed in initial caps or all caps. The programs and applications presented in this book have been included for their instructional value. They have been tested with care, but are not guaranteed for any particular purpose. The publisher does not offer any warranties or representations, nor does it accept any liabilities with respect to the programs or applications. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED AS PART OF THE SERVICES FOR ANY PURPOSE. ALL SUCH DOCUMENTS AND RELATED GRAPHICS ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THIS INFORMATION, INCLUDING ALL WARRANTIES AND CONDITIONS OF MERCHANTABILITY. WHETHER EXPRESS, IMPLIED OR STATUTORY, FITNESS FOR A PARTICULAR. PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT. NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF INFORMATION AVAILABLE FROM THE SERVICES. THE DOCUMENTS AND RELATED GRAPHICS CONTAINED HEREIN COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED HEREIN AT ANY TIME PARTIAL SCREEN SHOTS MAY BE VIEWED IN FULL WITHIN THE SOFTWARE VERSION SPECIFIED. ® ® ® MICROSOFT WINDOWS , AND MICROSOFT OFFICE ARE REGISTERED TRADEMARKS OF THE MICROSOFT CORPORATION IN THE U.S.A AND OTHER COUNTRIES. THIS BOOK IS NOT SPONSORED OR ENDORSED BY OR AFFILIATED WITH THE MICROSOFT CORPORATION. Library of Congress Cataloging-in-Publication Data Names: Gaddis, Tony, author. | Irvine, Kip R., author. Title: Starting out with Visual Basic / Tony Gaddis, Haywood Community College, Kip Irvine, Florida International University. Description: Seventh edition. | Boston : Pearson, 2016. | Includes bibliographical references and index. Identifiers: LCCN 2016000100 | ISBN 9780134400150 | ISBN 0134400151 Subjects: LCSH: Visual Basic (Computer program language) Classification: LCC QA76.73.M53 G33 2016 | DDC 005.26/8—dc23 LC record available at http://lccn.loc.gov/2016000100 10 9 8 7 6 5 4 3 2 1 ISBN 10:     0-13-440015-1 ISBN 13: 978-0-13-440015-0 Contents in Brief 1. Preface xvii 1. Chapter 1 Introduction to Programming and Visual Basic 1 2. Chapter 2 Creating Applications with Visual Basic 41 3. Chapter 3 Variables and Calculations 125 4. Chapter 4 Making Decisions 233 5. Chapter 5 Lists and Loops 309 6. Chapter 6 Procedures and Functions 379 7. Chapter 7 Multiple Forms, Modules, and Menus 429 8. Chapter 8 Arrays and More 499 9. Chapter 9 Files, Printing, and Structure 573 10. Chapter 10 Working with Databases 631 11. Chapter 11 Developing Web Applications 711 12. Chapter 12 Classes, Collections, and Inheritance 767 1. Appendix A Advanced User Interface Controls and Techniques 829 2. Appendix B Windows Presentation Foundation (WPF) 843 3. Appendix C Converting Mathematical Expressions to Programming Statements 851 4. Appendix D Answers to Checkpoint 853 5. Appendix E Glossary 871 6. Index 883 7. Credits 909 Contents 1. Preface xvii 1. Chapter 1 Introduction to Programming and Visual Basic 1 1. 1.1 Computer Systems: Hardware and Software 1 2. 1.2 Programs and Programming Languages 4 3. Tutorial 1-1: Running the Wage Calculator application 8 4. Tutorial 1-2: Running an application that demonstrates event handlers 10 5. 1.3 More about Controls and Programming 11 6. Tutorial 1-3: Running an application that demonstrates various controls 12 7. 1.4 The Programming Process 16 8. 1.5 Visual Studio 20 9. Tutorial 1-4: Starting Visual Studio and setting up the environment 20 10. Tutorial 1-5: Starting a new Visual Basic project 24 11. Tutorial 1-6: Becoming familiar with Visual Studio 33 1. Summary 35 2. Key Terms 36 3. Review Questions and Exercises 36 4. Programming Challenges 40 2. Chapter 2 Creating Applications with Visual Basic 41 1. 2.1 Getting Started with Forms and Controls 41 2. 2.2 Creating the GUI for Your First Visual Basic Application: The Hello World Application 52 3. Tutorial 2-1: Creating the GUI for the Hello World application 53 4. 2.3 Writing the Code for the Hello World Application 59 5. Tutorial 2-2: Writing code for the Hello World application 62 6. 2.4 More about Label Controls 68 7. 2.5 Creating Multiple Event Handlers 76 8. Tutorial 2-3: Creating the Language Translator application 77 9. 2.6 Making Sense of IntelliSense 80 10. 2.7 PictureBox Controls 81 11. Tutorial 2-4: Creating the Guess the President application 84 12. Tutorial 2-5: Writing Click event handlers for PictureBox controls 87 13. 2.8 The Visible Property 90 14. Tutorial 2-6: Creating the Card Flip application 91 15. 2.9 Writing the Code to Close an Application’s Form 94 16. Tutorial 2-7: Adding an Exit Button to the Guess the President application 95 17. 2.10 Comments, Blank Lines, and Indentation 98 18. 2.11 Dealing with Errors 99 19. 2.12 Displaying User Messages at Runtime 102 20. Tutorial 2-8: Displaying Message Boxes 103 21. 2.13 Customizing an Application’s Form 107 22. Tutorial 2-9: Setting the FormBorderStyle property and locking the controls on a Form 109 23. 2.14 Using Visual Studio Help 110 1. Summary 112 2. Key Terms 114 3. Review Questions 115 4. Programming Challenges 120 3. Chapter 3 Variables and Calculations 125

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.