BEGINNING
Visual Basic 2015
Bryan Newsome
Beginning Visual Basic 2015
Published by
John Wiley & Sons, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright 2016 by John Wiley & Sons, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-1-119-09211-7
ISBN: 978-1-119-09207-0 (ebk)
ISBN: 978-1-119-09208-7 (ebk)
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2015953114
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. Visual Basic is a registered trademark of Microsoft Corporation. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book.
For my girls, Jennifer and Katelyn.
ABOUT THE AUTHOR
BRYAN NEWSOME leads a team of top developers specializing in Microsoft solutions. Since starting building Visual Basic 5 solutions, he has embraced each new version of Visual Basic and now creates all new solutions leveraging the .NET platform and VB.NET. He provides clients with solutions and mentoring on leading-edge Microsoft technologies. For VB.NET, Bryan is a Microsoft Certified Application Developer.
ABOUT THE TECHNICAL EDITOR
VALAN MONEY is a Microsoft Certified Solution Developer for Web and Windows applications. He has been using Visual Basic since 1996 and got his first certification in Visual Basic 4.0. Since then, he has also received certifications in newer versions of VB and VB.NET. He works as Technical Team Lead and Senior Consultant for projects using Microsoft technologies. He holds a Masters degree in Computer Science from St. Josephs College, Tiruchirappalli, India.
CREDITS
Senior Acquisitions Editor
Kenyon Brown
Project Editor
Maureen S. Tullis
Technical Editor
Valan Money
Production Editor
Dassi Zeidel
Copy Editor
Scott D. Tullis
Manager of Content Development
& Assembly
Mary Beth Wakefield
Marketing Director
David Mayhew
Marketing Manager
Carrie Sherrill
Professional Technology
& Strategy Director
Barry Pruett
Business Manager
Amy Knies
Associate Publisher
Jim Minatel
Project Coordinator, Cover
Brent Savage
Proofreader
Nancy Carrasco
Indexer
Johnna VanHoose Dinse
Cover Designer
Wiley
Cover Image
anasimin/iStockphoto
ACKNOWLEDGMENTS
Thanks to those who worked so hard to get this book on the shelves at Wiley and Wrox. Special thanks (again) to Maureen Tullis who went above and beyond to help me finish mostly on schedule.
INTRODUCTION
VISUAL BASIC 2015 IS Microsofts latest version of the highly popular Visual Basic .NET programming language, one of the many languages supported in Visual Studio 2015. Visual Basic 2015s strength lies in its ease of use and the speed at which you can create Windows Forms and Windows 8 applications, web applications, and mobile device applications.
In this book, we introduce you to programming with Visual Basic 2015 and show you how to create these types of applications and services. Along the way youll also learn about object-oriented techniques and learn how to create your own business objects and Windows controls.
Microsofts .NET Framework provides Visual Basic 2015 programmers with the capability to create full object-oriented programs, just like the ones created using C# or C++. The .NET Framework provides a set of base classes that are common to all programming languages in Visual Studio 2015, which provides you with the same capability to create object-oriented programs as a programmer using C# or C++.
This book will give you a thorough grounding in the basics of programming using Visual Basic 2015; from there the world is your oyster.
WHO THIS BOOK IS FOR
This book is designed to teach you how to write useful programs in Visual Basic 2015 as quickly and easily as possible.
There are two kinds of beginners for whom this book is ideal:
- Youre a beginner to programming and youve chosen Visual Basic 2015 as the place to start. Thats a great choice! Visual Basic 2015 is not only easy to learn, its also fun to use and very powerful.
- You can program in another language but youre a beginner to .NET programming. Again, youve made a great choice! Whether youve come from Fortran or Cobol, youll find that this book quickly gets you up to speed on what you need to know to get the most from Visual Basic 2015.
Next page