Programming With Microsoft Visual Basic 2012 6th Edition Zak instant download
Programming With Microsoft Visual Basic 2012 6th Edition Zak instant download
https://ebookbell.com/product/programming-with-microsoft-visual-
basic-2012-6th-edition-zak-55132386
Clearly Visual Basic Programming With Microsoft Visual Basic 2012 3rd
Edition Diane Zak
https://ebookbell.com/product/clearly-visual-basic-programming-with-
microsoft-visual-basic-2012-3rd-edition-diane-zak-4178308
https://ebookbell.com/product/programming-microsoft-windows-with-
microsoft-visual-basic-net-core-reference-prodeveloper-illustrated-
edition-petzold-1273112
Programming Microsoft Sql Server 2000 With Microsoft Visual Basic Net
1st Edition Dobson
https://ebookbell.com/product/programming-microsoft-sql-
server-2000-with-microsoft-visual-basic-net-1st-edition-
dobson-55141988
https://ebookbell.com/product/programming-with-microsoft-visual-
basic-2010-vbnet-programming-5th-edition-zak-55139980
Programming With Microsoft Visual Basic 2015 7th Edition Diane Zak
https://ebookbell.com/product/programming-with-microsoft-visual-
basic-2015-7th-edition-diane-zak-5312274
Programming With Microsoft Visual Basic 2017 Mindtap Course List 8th
Edition Zak
https://ebookbell.com/product/programming-with-microsoft-visual-
basic-2017-mindtap-course-list-8th-edition-zak-55132312
Clearly Visual Basic Programming With Microsoft Visual Basic 2010 2nd
Edition Diane Zak
https://ebookbell.com/product/clearly-visual-basic-programming-with-
microsoft-visual-basic-2010-2nd-edition-diane-zak-2382420
Microsoft Aspnet Programming With Visual Basic Net Version 2003 Step
By Step 1st Edition G Andrew Duthie
https://ebookbell.com/product/microsoft-aspnet-programming-with-
visual-basic-net-version-2003-step-by-step-1st-edition-g-andrew-
duthie-1352776
https://ebookbell.com/product/programming-with-microsoft-visual-c-net-
sixth-edition-george-shepherd-david-kruglinski-62157456
PROGRAMMING WITH
MICROSOFT® VISUAL BASIC® 2012
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
SIXTH EDITION
PROGRAMMING
WITH MICROSOFT®
VISUAL BASIC® 2012
DIANE ZAK
Australia l Brazil l Japan l Korea l Mexico l Singapore l Spain l United Kingdom l United States
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
This is an electronic version of the print textbook. Due to electronic rights restrictions, some third party content may be suppressed. Editorial
review has deemed that any suppressed content does not materially affect the overall learning experience. The publisher reserves the right to
remove content from this title at any time if subsequent rights restrictions require it. For valuable information on pricing, previous
editions, changes to current editions, and alternate formats, please visit www.cengage.com/highered to search by
ISBN#, author, title, or keyword for materials in your areas of interest.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Programming with Microsoft® © 2014 Course Technology, Cengage Learning
Visual Basic® 2012, Sixth Edition
ALL RIGHTS RESERVED. No part of this work covered by the copyright herein may be
Diane Zak reproduced, transmitted, stored, or used in any form or by any means graphic, electronic,
or mechanical, including but not limited to photocopying, recording, scanning, digitizing,
Executive Editor: Kathleen McMahon
taping, Web distribution, information networks, or information storage and retrieval
Senior Product Manager: Alyssa Pratt systems, except as permitted under Section 107 or 108 of the 1976 United States
Editorial Assistant: Sarah Ryan Copyright Act, without the prior written permission of the publisher.
Brand Marketing Manager: Kay Stefanski
Senior Content Project Manager: For product information and technology assistance, contact us at
Matthew Hutchinson Cengage Learning Customer & Sales Support, 1-800-354-9706
Quality Assurance: Nicole Spoto
For permission to use material from this text or product,
Art Director: Cheryl Pearl, GEX submit all requests online at www.cengage.com/permissions.
Cover Designer: Cheryl Pearl, GEX Further permissions questions can be emailed to
permissionrequest@cengage.com.
Print Buyer: Julio Esperas
Proofreader: Kathy Orrino
Indexer: Alexandra Nickerson Library of Congress Control Number: 2012956117
Compositor: ISBN-13: 978-1-285-07792-5
Integra Software Services Pvt. Ltd.
ISBN-10: 1-285-07792-X
Course Technology
20 Channel Center Street
Boston, MA 02210
USA
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Brief Contents
v
Preface . . . . . . . . . . . . . . . . . . . . . . . . xviii
Read This Before You Begin . . . . . . . . . . . . . . . . xxii
C H AP T E R 2 Designing Applications . . . . . . . . . . . . . . . . . . 59
C H AP T E R 9 Arrays . . . . . . . . . . . . . . . . . . . . . . . . . 525
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
BRIEF CONTENTS
Index . . . . . . . . . . . . . . . . . . . . . . . . . . 921
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Contents
vii
Preface . . . . . . . . . . . . . . . . . . . . . . . xviii
Read This Before You Begin . . . . . . . . . . . . . . xxii
LESSON B T h e T o o lb o x W i n d o w . . . . . . . . . . . . . . . . . . . . . . . . 29
The Label Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Setting the Text Property . . . . . . . . . . . . . . . . . . . . . . . . . 32
Setting the Location Property . . . . . . . . . . . . . . . . . . . . . . . 32
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
CONTENTS
C H AP T E R 2 Designing Applications . . . . . . . . . . . . . . . . . 59
LESSON A C r ea t in g a n O b j ec t- O r i en t ed Ap p li ca t io n . . . . . . . . . . . . . . . 62
Planning an Object-Oriented Application . . . . . . . . . . . . . . . . . . . . 62
Identifying the Application’s Tasks . . . . . . . . . . . . . . . . . . . . . 63
Identifying the Objects . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Identifying the Events . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Drawing a Sketch of the User Interface . . . . . . . . . . . . . . . . . . . 67
Lesson A Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Lesson A Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Lesson A Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . 70
Lesson A Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
LESSON B B u il din g t h e U s e r In t er f ac e . . . . . . . . . . . . . . . . . . . . . 72
Including Graphics in the User Interface . . . . . . . . . . . . . . . . . . . 73
Selecting Fonts for the Interface . . . . . . . . . . . . . . . . . . . . . . 73
Adding Color to the Interface . . . . . . . . . . . . . . . . . . . . . . . 74
The BorderStyle, AutoSize, and TextAlign Properties . . . . . . . . . . . . . . 74
Adding a Text Box Control to the Form . . . . . . . . . . . . . . . . . . . 76
Locking the Controls on a Form . . . . . . . . . . . . . . . . . . . . . . . 77
Assigning Access Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Controlling the Tab Order . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Lesson B Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Lesson B Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Lesson B Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . 82
Lesson B Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
LESSON C C o d i ng t h e Ap p li ca t io n . . . . . . . . . . . . . . . . . . . . . . . 86
Using Pseudocode to Plan a Procedure . . . . . . . . . . . . . . . . . . . 87
Using a Flowchart to Plan a Procedure . . . . . . . . . . . . . . . . . . . 88
Coding the btnClear Control’s Click Event Procedure . . . . . . . . . . . . . . . 89
Assigning a Value to a Property during Run Time . . . . . . . . . . . . . . . 89
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Using the Focus Method . . . . . . . . . . . . . . . . . . . . . . . . . 91
Internally Documenting the Program Code . . . . . . . . . . . . . . . . . . 91
Coding the btnPrint Control’s Click Event Procedure . . . . . . . . . . . . . . . 93
Writing Arithmetic Expressions . . . . . . . . . . . . . . . . . . . . . . . . 95
Coding the btnCalc Control’s Click Event Procedure . . . . . . . . . . . . . . . 97
The Val Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
The Format Function . . . . . . . . . . . . . . . . . . . . . . . . . . 100 ix
Testing and Debugging the Application . . . . . . . . . . . . . . . . . . . 101
Assembling the Documentation . . . . . . . . . . . . . . . . . . . . . . . 104
Lesson C Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Lesson C Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Lesson C Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 107
Lesson C Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
LESSON C M o di f yi n g th e Lo a d an d C l ic k E ve n t Pr o ce d u r es . . . . . . . . . . . 1 7 1
Coding the TextChanged Event Procedure . . . . . . . . . . . . . . . . . . 174
Associating a Procedure with Different Objects and Events . . . . . . . . . . 174
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
CONTENTS
LESSON B Cr ea ti n g th e C o vi n gt o n R es o r t A p p li ca t io n . . . . . . . . . . . . . 223
Adding a Group Box to the Form . . . . . . . . . . . . . . . . . . . . . 224
Coding the Covington Resort Application . . . . . . . . . . . . . . . . . . . 226
Coding the btnCalc Control’s Click Event Procedure . . . . . . . . . . . . . 226
The MessageBox.Show Method . . . . . . . . . . . . . . . . . . . . . . 230
Completing the btnCalc_Click Procedure . . . . . . . . . . . . . . . . . . . 233
Lesson B Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Lesson B Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Lesson B Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 237
Lesson B Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
LESSON C C o d i ng t h e Ke yP r es s E v en t P r o c ed u r e s . . . . . . . . . . . . . . 240
Coding the Enter Event Procedures . . . . . . . . . . . . . . . . . . . . . 243
Lesson C Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Lesson C Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Lesson C Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 247
Lesson C Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Third Logic Error: Using an Unnecessary Nested Selection Structure . . . . . . 270
Fourth Logic Error: Including an Unnecessary Comparison in a Condition . . . . 271
Multiple-Alternative Selection Structures . . . . . . . . . . . . . . . . . . . 272
The Select Case Statement . . . . . . . . . . . . . . . . . . . . . . . . 275
Specifying a Range of Values in a Case Clause . . . . . . . . . . . . . . . 277
Lesson A Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Lesson A Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 xi
Lesson A Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 280
Lesson A Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
LESSON C U s in g t h e T r yP ar s e M et h o d f o r D at a V a li d a ti o n . . . . . . . . . . . 312
Generating Random Integers . . . . . . . . . . . . . . . . . . . . . . . . 315
Showing and Hiding a Control . . . . . . . . . . . . . . . . . . . . . . . 319
Lesson C Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Lesson C Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Lesson C Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 322
Lesson C Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
CONTENTS
LESSON C C r ea t in g t he G r o s s P ay A p p l ic at i o n . . . . . . . . . . . . . . . . 388
xii Including a List Box in an Interface . . . . . . . . . . . . . . . . . . . . . 388
Adding Items to a List Box . . . . . . . . . . . . . . . . . . . . . . . 389
The Sorted Property . . . . . . . . . . . . . . . . . . . . . . . . . . 390
Coding the Gross Pay Application . . . . . . . . . . . . . . . . . . . . . . 391
The SelectedItem and SelectedIndex Properties . . . . . . . . . . . . . . . 393
The SelectedValueChanged and SelectedIndexChanged Events . . . . . . . . 395
Coding the Calculate Button’s Click Event Procedure . . . . . . . . . . . . . 396
Lesson C Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Lesson C Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Lesson C Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 399
Lesson C Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
LESSON C C r ea t in g t he C er r ut i C o m p a ny A p p l ic at i o n . . . . . . . . . . . . . 448
Coding the FormClosing Event Procedure . . . . . . . . . . . . . . . . . . 449
Coding the btnCalc_Click Procedure . . . . . . . . . . . . . . . . . . . . 451
Creating the GetFwt Function . . . . . . . . . . . . . . . . . . . . . . 453
Completing the btnCalc_Click Procedure . . . . . . . . . . . . . . . . . . . 457
Rounding Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
Lesson C Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
Lesson C Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
Lesson C Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 465
Lesson C Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Inserting Characters in a String . . . . . . . . . . . . . . . . . . . . . . 476
Aligning the Characters in a String . . . . . . . . . . . . . . . . . . . . 477
The Net Pay Application . . . . . . . . . . . . . . . . . . . . . . . . . 478
Searching a String . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
The City and State Application . . . . . . . . . . . . . . . . . . . . . . 481
Accessing the Characters in a String . . . . . . . . . . . . . . . . . . . . 483
The Rearrange Name Application . . . . . . . . . . . . . . . . . . . . . 484 xiii
Using Pattern-Matching to Compare Strings . . . . . . . . . . . . . . . . . 486
Modifying the Product ID Application . . . . . . . . . . . . . . . . . . . 488
Lesson A Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
Lesson A Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Lesson A Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 491
Lesson A Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
LESSON B Ad d in g a M en u t o a F o r m . . . . . . . . . . . . . . . . . . . . . 497
Assigning Shortcut Keys to Menu Items . . . . . . . . . . . . . . . . . . 501
Coding the Exit Menu Item . . . . . . . . . . . . . . . . . . . . . . . . 503
Coding the txtLetter Control’s KeyPress Event . . . . . . . . . . . . . . . 503
Lesson B Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Lesson B Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Lesson B Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 504
Lesson B Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
C H AP T E R 9 Arrays . . . . . . . . . . . . . . . . . . . . . . . . 525
LESSON A A r r a ys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
One-Dimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . 528
Declaring a One-Dimensional Array . . . . . . . . . . . . . . . . . . . . 528
Storing Data in a One-Dimensional Array . . . . . . . . . . . . . . . . . . 530
Determining the Number of Elements in a One-Dimensional Array . . . . . . . . 531
Determining the Highest Subscript in a One-Dimensional Array . . . . . . . . . 531
Traversing a One-Dimensional Array . . . . . . . . . . . . . . . . . . . . 532
The For Each…Next Statement . . . . . . . . . . . . . . . . . . . . . . 533
Calculating the Total and Average Values . . . . . . . . . . . . . . . . . . 535
Finding the Highest Value . . . . . . . . . . . . . . . . . . . . . . . . . 537
Sorting a One-Dimensional Array . . . . . . . . . . . . . . . . . . . . . . 542
Lesson A Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
Lesson A Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
Lesson A Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 546
Lesson A Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
LESSON B Ar r ay s an d C o ll ec ti o n s . . . . . . . . . . . . . . . . . . . . . . 5 5 4
Accumulator and Counter Arrays . . . . . . . . . . . . . . . . . . . . . . 558
Parallel One-Dimensional Arrays . . . . . . . . . . . . . . . . . . . . . . 561
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
CONTENTS
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Example 2—A Class that Contains Private Variables, Public Properties,
and Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
Private Variables and Property Procedures . . . . . . . . . . . . . . . . . 654
Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
Methods Other than Constructors . . . . . . . . . . . . . . . . . . . . . 659
Coding the Carpets Galore Application . . . . . . . . . . . . . . . . . . . 660
Example 3—A Class that Contains a Parameterized Constructor . . . . . . . . . 664 xv
Example 4—Reusing a Class . . . . . . . . . . . . . . . . . . . . . . . 668
Lesson A Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
Lesson A Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 673
Lesson A Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 674
Lesson A Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
LESSON B Ex a mp le 5 — A C la s s t ha t C o n ta in s a R ea d O nl y P r o p er t y . . . . . . . 680
Example 6—A Class that Contains Auto-Implemented Properties . . . . . . . . . 685
Example 7—A Class that Contains Overloaded Methods . . . . . . . . . . . . 687
Lesson B Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
Lesson B Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
Lesson B Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 694
Lesson B Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
LESSON C E x a m p l e 8 —U s i ng a B as e C la ss an d a D er iv ed Cl as s . . . . . . . . 698
Lesson C Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
Lesson C Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
Lesson C Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 704
Lesson C Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
LESSON B Dy n am i c W eb Pa g es . . . . . . . . . . . . . . . . . . . . . . . 732
Coding the Submit Button’s Click Event Procedure . . . . . . . . . . . . . . . 735
Validating User Input . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
Lesson B Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
Lesson B Key Term . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
Lesson B Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 742
Lesson B Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
CONTENTS
LESSON C C r ea t in g t he D J T o m A p p li ca t io n . . . . . . . . . . . . . . . . . 746
Creating a Columnar Layout . . . . . . . . . . . . . . . . . . . . . . . . 747
Using an ASP Table . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
Dragging Controls in Source View . . . . . . . . . . . . . . . . . . . . 751
Adding Items to a DropDownList Control . . . . . . . . . . . . . . . . . . . 754
Coding DJ Tom’s Web Page . . . . . . . . . . . . . . . . . . . . . . . . 755
xvi Using the <br /> Tag . . . . . . . . . . . . . . . . . . . . . . . . . 756
Lesson C Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 758
Lesson C Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 758
Lesson C Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 759
Lesson C Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
LESSON B Cr ea ti n g a Q ue r y . . . . . . . . . . . . . . . . . . . . . . . . 796
Customizing a BindingNavigator Control . . . . . . . . . . . . . . . . . . . 800
Using the LINQ Aggregate Operators . . . . . . . . . . . . . . . . . . . . 802
Lesson B Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 806
Lesson B Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
Lesson B Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 807
Lesson B Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 809
LESSON C C o m p l et in g t h e P a r ad is e B o o k s t o r e A p p l ic at io n . . . . . . . . . . . 811
Coding the Paradise Bookstore Application . . . . . . . . . . . . . . . . . . 813
Lesson C Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
Lesson C Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
Lesson C Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 816
Lesson C Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 817
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Lesson A Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 837
Lesson A Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 838
Lesson A Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
LESSON B S t r u ct u r ed Q u er y L an g u ag e . . . . . . . . . . . . . . . . . . . . 841
The SELECT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . 841
Creating a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843 xvii
Lesson B Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
Lesson B Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 851
Lesson B Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 851
Lesson B Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 853
LESSON C P ar am e te r Q u e r ie s . . . . . . . . . . . . . . . . . . . . . . . . 855
Saving a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858
Invoking a Query from Code . . . . . . . . . . . . . . . . . . . . . . . . 861
The INSERT and DELETE Statements . . . . . . . . . . . . . . . . . . . . 863
Lesson C Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 873
Lesson C Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 873
Lesson C Review Questions . . . . . . . . . . . . . . . . . . . . . . . . 873
Lesson C Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 874
Index . . . . . . . . . . . . . . . . . . . . . . . . 921
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Preface
xviii
Programming with Microsoft Visual Basic 2012, Sixth Edition uses Visual Basic 2012, an object-oriented
language, to teach programming concepts. This book is designed for a beginning programming course.
However, it assumes students are familiar with basic Windows skills and file management.
Approach
Programming with Microsoft Visual Basic 2012, Sixth Edition teaches programming concepts using a task-driven
rather than a command-driven approach. By working through the chapters, which are each motivated by a
realistic case, students learn how to develop applications they are likely to encounter in the workplace. This is
much more effective than memorizing a list of commands out of context. The book motivates students by
demonstrating why they need to learn the concepts and skills covered in each chapter.
Features
Programming with Microsoft Visual Basic 2012, Sixth Edition is an exceptional textbook because it also includes
the following features:
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Organization and Coverage
READ THIS BEFORE YOU BEGIN This section is consistent with Course Technology’s unequaled commitment to
helping instructors introduce technology into the classroom. Technical considerations and assumptions about
hardware, software, and default settings are listed in one place to help instructors save time and eliminate
unnecessary aggravation.
YOU DO IT! BOXES These boxes provide simple applications that allow students to demonstrate their
understanding of a concept before moving on to the next concept. The YOU DO IT! boxes are located almost xix
exclusively in Lesson A of each chapter.
VISUAL STUDIO 2012 METHODS The book focuses on Visual Studio 2012 methods rather than on Visual Basic
functions. This is because the Visual Studio methods can be used in any .NET language, whereas the Visual
Basic functions can be used only in Visual Basic. Exceptions to this are the Val and Format functions, which are
introduced in Chapter 2. These functions are covered in the book simply because it is likely that students will
encounter them in existing Visual Basic programs. However, in Chapter 3, the student is taught to use the
TryParse method and the Convert class methods rather than the Val function. Also in Chapter 3, the Format
function is replaced with the ToString method.
OPTION STATEMENTS All programs include the Option Explicit, Option Strict, and Option Infer statements.
START HERE ARROWS These arrows indicate the beginning of a tutorial steps section in the book.
DATABASES, LINQ, AND SQL The book includes two chapters (Chapters 13 and 14) on databases. LINQ is
covered in Chapter 13. SQL is covered in Chapter 14.
FIGURES Figures that introduce new statements, functions, or methods contain both the syntax and examples
of using the syntax. Including the syntax in the figures makes the examples more meaningful, and vice versa.
CHAPTER CASES Each chapter begins with a programming-related problem that students could reasonably
expect to encounter in business, followed by a demonstration of an application that could be used to solve
the problem. Showing the students the completed application before they learn how to create it is motivational
and instructionally sound. By allowing the students to see the type of application they will be able to create
after completing the chapter, the students will be more motivated to learn because they can see how the
programming concepts they are about to learn can be used and, therefore, why the concepts are important.
LESSONS Each chapter is divided into three lessons—A, B, and C. Lesson A introduces the programming
concepts that will be used in the completed application. The concepts are illustrated with code examples and
sample applications. The user interface for each sample application is provided to the student. Also provided are
tutorial-style steps that guide the student on coding, running, and testing the application. Each sample
application allows the student to observe how the current concept can be used before the next concept is
introduced. In Lessons B and/or C, the student creates the application required to solve the problem specified in
the Chapter Case.
APPENDICES Appendix A, which can be covered after Chapter 3, teaches students how to locate and correct
errors (syntax, logic, and run time) in their code. The appendix shows students how to step through their code
and also how to create breakpoints. Appendix B summarizes the GUI design guidelines taught in the chapters,
making it easier for the student to follow the guidelines when designing an application’s interface. Appendix C
lists the Visual Basic conversion functions. Appendix D contains a Cheat Sheet that summarizes important
concepts covered in the chapters, such as the syntax of statements, methods, and so on. The Cheat Sheet
provides a convenient place for students to locate the information they need as they are creating and coding
their applications. Appendix E contains Case Projects that can be assigned after completing specific chapters in
the book. Appendix F, which is available online at www.cengagebrain.com, covers multiple-form applications and
the FontDialog, ColorDialog, and TabControl tools.
GUI DESIGN TIP BOXES The GUI DESIGN TIP boxes contain guidelines and recommendations for designing
applications that follow Windows standards. Appendix B provides a summary of the GUI design guidelines
covered in the chapters.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
PREFACE Instructor Resources
TIP These notes provide additional information about the current concept. Examples include
alternative ways of writing statements or performing tasks, as well as warnings about common
mistakes made when using a particular command and reminders of related concepts learned in
previous chapters.
SUMMARY Each lesson contains a Summary section that recaps the concepts covered in the lesson.
xx KEY TERMS Following the Summary section in each lesson is a listing of the key terms introduced throughout
the lesson, along with their definitions.
REVIEW QUESTIONS Each lesson contains Review Questions designed to test a student’s understanding of the
lesson’s concepts.
EXERCISES The Review Questions in each lesson are followed by Exercises, which provide students with
additional practice of the skills and concepts they learned in the lesson. The Exercises are designated as
INTRODUCTORY, INTERMEDIATE, ADVANCED, DISCOVERY, and SWAT THE BUGS. The DISCOVERY
Exercises encourage students to challenge and independently develop their own programming skills while
exploring the capabilities of Visual Basic 2012. The SWAT THE BUGS Exercises provide an opportunity for
students to detect and correct errors in an application’s code.
Chapters 4, 5, and 7
The following two topics were moved from Chapter 4 to Chapter 5: the TryParse method’s return value and
the comparison of Boolean values. The Financial.Pmt method was removed from Chapter 4. In the previous
edition of the book, independent Sub procedures were introduced in Chapter 5 and then covered more fully
in Chapter 7. In this edition, independent Sub procedures are now covered in one place: Chapter 7.
Instructor Resources
The following teaching tools are available for download at our Instructor Companion Site. Simply search for this
text at login.cengage.com. An instructor login is required.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Acknowledgments
ELECTRONIC INSTRUCTOR’S MANUAL The Instructor’s Manual that accompanies this textbook includes
additional instructional material to assist in class preparation, including items such as Sample Syllabi, Chapter
Outlines, Technical Notes, Lecture Notes, Quick Quizzes, Teaching Tips, Discussion Topics, and Additional
Case Projects.
EXAMVIEW® This textbook is accompanied by ExamView, a powerful testing software package that allows
instructors to create and administer printed, computer (LAN-based), and Internet exams. ExamView includes xxi
hundreds of questions that correspond to the topics covered in this text, enabling students to generate detailed
study guides that include page references for further review. The computer-based and Internet testing
components allow students to take exams at their computers, and also save the instructor time by grading each
exam automatically.
POWERPOINT PRESENTATIONS This book offers Microsoft PowerPoint slides for each chapter. These are
included as a teaching aid for classroom presentation, to make available to students on the network for chapter
review, or to be printed for classroom distribution. Instructors can add their own slides for additional topics
they introduce to the class.
SOLUTION FILES Solutions to the Lesson applications and the end-of-lesson Review Questions and Exercises
are provided.
DATA FILES Data Files are necessary for completing the computer activities in this book. Data Files can also be
downloaded by students at www.cengagebrain.com.
CourseMate
The more you study, the better the results. Make the most of your study time by accessing everything
you need to succeed in one place. Read your textbook, take notes, review flashcards, watch videos, and
take practice quizzes online. CourseMate goes beyond the book to deliver what you need! Learn more at
www.cengage.com/coursemate.
The Visual Basic CourseMate includes:
l Video Lessons: Each chapter is accompanied by several video lessons that help to explain important chapter
concepts. These videos were created and narrated by the author.
l An interactive eBook, quizzes, flashcards, and more!
Instructors may add CourseMate to the textbook package, or students may purchase CourseMate
directly at www.cengagebrain.com.
Acknowledgments
Writing a book is a team effort rather than an individual one. I would like to take this opportunity to thank my
team, especially Alyssa Pratt (Senior Project Manager), Sreejith Govindan (Full Service Project Manager), Nicole
Spoto (Quality Assurance), Matt Hutchinson (Content Project Manager), Kathy Orrino (Proofreader), and
the compositors at Integra. Thank you for your support, enthusiasm, patience, and hard work. Last, but
certainly not least, I want to thank the following reviewers for their invaluable ideas and comments: Mary Brock:
Mississippi University for Women; John Buerck: Saint Louis University; Jane Hammer: Valley City University;
Donna Petty: Wallace Community College; and Helen Schneider: The University of Findlay. And a special thank
you to Sally Douglas (College of Central Florida) for suggesting the YOU DO IT! boxes.
Diane Zak
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Read This Before
You Begin
xxii
Technical Information
Data Files
You will need data files to complete the computer activities in this book. Your instructor may provide the data
files to you. You may obtain the files electronically at www.cengagebrain.com, and then navigating to the page for
this book.
Each chapter in this book has its own set of data files, which are stored in a separate folder within the VB2012
folder. The files for Chapter 1 are stored in the VB2012\Chap01 folder. Similarly, the files for Chapter 2 are
stored in the VB2012\Chap02 folder. Throughout this book, you will be instructed to open files from or save
files to these folders.
You can use a computer in your school lab or your own computer to complete the steps and Exercises
in this book.
Figures
The figures in this book reflect how your screen will look if you are using Microsoft Visual Studio Professional
2012 and a Microsoft Windows 8 system. Your screen may appear slightly different in some instances if you are
using another version of either Microsoft Visual Studio or Microsoft Windows.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Technical Information
To the Instructor
To complete the computer activities in this book, your students must use a set of data files. These files can be
obtained electronically at www.cengagebrain.com.
The material in this book was written using Microsoft Visual Studio Professional 2012 on a Microsoft Windows
8 system. It was Quality Assurance tested using Microsoft Visual Studio Professional 2012 on a Microsoft
Windows 7 system, and using Microsoft Visual Studio Express 2012 for Web on a Microsoft Windows 8 system. xxiii
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
OVERVIEW
An Introduction to
Programming
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
OVERVIEW An Introduction to Programming
Programming a Computer
In essence, the word programming means giving a mechanism the directions to accomplish a
task. If you are like most people, you’ve already programmed several mechanisms, such as your
digital video recorder (DVR), cell phone, or coffee maker. Like these devices, a computer also is
a mechanism that can be programmed.
2 The directions given to a computer are called computer programs or, more simply, programs.
The people who write programs are called programmers. Programmers use a variety of special
languages, called programming languages, to communicate with the computer. Some popular
programming languages are Visual Basic, C#, C++, and Java. In this book, you will use the Visual
Basic programming language.
Employment Opportunities
When searching for a job in computer programming, you will encounter ads for “computer
programmers” as well as for “computer software engineers.” Although job titles and descriptions
Overview-
vary, computer software engineers typically are responsible for designing an appropriate solution
Programmer to a user’s problem, while computer programmers are responsible for translating the solution
Qualities into a language that the computer can understand. The process of translating the solution is
video called coding.
Keep in mind that, depending on the employer and the size and complexity of the user’s
problem, the design and coding tasks may be performed by the same employee, no matter what
his or her job title is. In other words, it’s not unusual for a software engineer to code her
solution, just as it’s not unusual for a programmer to have designed the solution he is coding.
Programmers and software engineers need to have strong problem-solving and analytical skills,
as well as the ability to communicate effectively with team members, end users, and other
nontechnical personnel. Typically, computer software engineers are expected to have at least a
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Visual Basic 2012
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
OVERVIEW An Introduction to Programming
include e-commerce applications available on the Internet, and employee handbook applications
accessible on a company’s intranet. You also can use Visual Basic to create applications for tablet
PCs and mobile devices, such as cell phones and PDAs (personal digital assistants).
text box
Don’t be
concerned if
labels
some of the
letters on your
screen are
underlined. You can
show/hide the underlined buttons
letters by pressing the
Alt key. Figure 1 Monthly Payment Calculator application
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Using the Chapters Effectively
5. Use the application to calculate the monthly payment for a $20,000 loan at 6.75%
interest for five years. Type 20000 in the Principal text box and then click 6.75 % in
the Interest list box. The radio button corresponding to the five-year term is already
selected, so you just need to click the Calculate button to compute the monthly
payment. The application indicates that your monthly payment would be $393.67.
See Figure 2.
5
6. Now determine what your monthly payment would be if you borrowed $10,000 at 8%
interest for four years. Type 10000 in the Principal text box. Scroll down the Interest list
box and then click 8.00 %. Click the 4 years radio button and then click the Calculate
button. The Monthly payment box shows $244.13.
7. Click the Exit button to close the application.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
OVERVIEW An Introduction to Programming
Each chapter is divided into three lessons. You might want to take a break between lessons.
Following each lesson is a Summary section that lists the important elements of the lesson. After
the Summary section is a listing of the key terms (including definitions) covered in the lesson.
Following the Key Terms section are questions and exercises designed to review and reinforce
the lesson’s concepts. You should complete all of the end-of-lesson questions and several
exercises before continuing to the next lesson. It takes a great deal of practice to acquire the
6 skills needed to create good programs, and future chapters assume that you have mastered the
information found in the previous chapters.
Some of the end-of-lesson exercises are Discovery exercises, which allow you to both “discover”
the solutions to problems on your own and experiment with material that is not covered in the
chapter. Some lessons also contain one or more Debugging exercises. In programming, the term
debugging refers to the process of finding and fixing any errors, called bugs, in a program.
Debugging exercises provide opportunities for you to find and correct the errors in existing
applications. Appendix A, which can be covered along with Chapter 3, guides you through the
process of locating and correcting a program’s errors (bugs).
Throughout the book you will find GUI (graphical user interface) design tips. These tips contain
guidelines and recommendations for designing applications. You should follow these guidelines
and recommendations so that your applications follow the Windows standards.
Summary
l Programs are the step-by-step instructions that tell a computer how to perform a task.
l Programmers use various programming languages to communicate with the computer.
l The creation of a good program requires a great deal of interaction between the programmer
and the user.
l Programmers rigorously test a program with sample data before releasing the program to
the user.
l It’s not unusual for the same person to perform the duties of both a software engineer and a
programmer.
l An object-oriented programming language, such as Visual Basic 2012, allows programmers
to use objects to accomplish a program’s goal. An object is anything that can be seen,
touched, or used.
l Every object in an object-oriented program is instantiated (created) from a class, which is a
pattern that tells the computer how the object should look and behave. An object is referred
to as an instance of the class.
l The process of locating and correcting the errors (bugs) in a program is called debugging.
Key Terms
Applications—programs created for the Windows environment, the Web, or mobile devices
Class—a pattern that the computer uses to create (instantiate) an object
Coding—the process of translating a solution into a language that the computer can understand
Computer programs—the directions given to computers; also called programs
Debugging—the process of locating and correcting the errors (bugs) in a program
IDE—integrated development environment
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Key Terms
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
CHAPTER 1
An Introduction to
Visual Basic 2012
In this chapter, you will use Visual Basic 2012, Microsoft’s newest
version of the Visual Basic language, to create a splash screen for the
Red Tree Inn. A splash screen is the first image that appears when an
application is started. It is used to introduce the application and to hold
the user’s attention while the application is being read into the
computer’s internal memory.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
CHAPTER 1 An Introduction to Visual Basic 2012
Chapter 1 is designed to help you get comfortable with the Visual Studio 2012 integrated
development environment. As you learned in the Overview, an integrated development
environment (IDE) is an environment that contains all of the tools and features you need to
create, run, and test your programs. As do all the chapters in this book, Chapter 1 contains three
lessons. You should complete a lesson in full and do all of the end-of-lesson questions and
several exercises before continuing to the next lesson.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
The Splash Screen Application LESSON A
& LESSON A
After studying Lesson A, you should be able to:
l Start and customize Visual Studio 2012
l Create a Visual Basic 2012 Windows application
l Manage the windows in the IDE 11
1. Windows 8: If necessary, tap the Windows logo key to switch to the Windows 8
tile-based mode, and then click the Visual Studio 2012 tile.
Windows 7: Click the Start button on the Windows 7 taskbar and then point to All
Programs. Click Microsoft Visual Studio 2012 on the All Programs menu and then
click Visual Studio 2012.
The Ch01A
2. If the Choose Default Environment Settings dialog box appears, click Visual Basic video
Development Settings and then click Start Visual Studio. demon-
strates all of
3. Click WINDOW on the menu bar, click Reset Window Layout, and then click the Yes
the steps contained in
button. When you start Visual Studio Professional 2012, your screen will appear similar Lesson A. You can view
to Figure 1-2. However, your menu bar may contain underlined letters, called access the video either before or
keys. You will learn about access keys in Chapter 2. (You can show/hide the access keys after completing the
by pressing the Alt key on your keyboard.) lesson.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
CHAPTER 1 An Introduction to Visual Basic 2012
Solution Explorer
Toolbox window’s tab Start Page window window
12
Team Explorer
window’s tab
Note: To select a different window layout, click TOOLS on the menu bar, click Import and
Export Settings, select the Reset all settings radio button, click the Next button, select the
appropriate radio button, click the Next button, click the settings collection you want to use,
and then click the Finish button.
Next, you will configure Visual Studio so that your screen agrees with the figures and tutorial
steps in this book. As mentioned in the Overview, the figures reflect how your screen will look if
you are using Visual Studio Professional 2012 and a Microsoft Windows 8 system. Your screen
may appear slightly different in some instances if you are using a different edition of Visual
Studio or if you are using another version of Microsoft Windows. Don't worry if your screen
display differs slightly from the figures.
START HERE To configure Visual Studio:
1. Click TOOLS on the menu bar and then click Options to open the Options dialog box.
Click the Projects and Solutions node. Use the information shown in Figure 1-3 to
select and deselect the appropriate check boxes. (Your dialog box will look slightly
different if you are using Windows 7. For example, the title bar text will be left-aligned
rather than centered, and the buttons on the title bar will look different.) When you are
finished, click the OK button to close the Options dialog box.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
The Splash Screen Application LESSON A
13
Projects and
Solutions node
The splash screen will be a Windows application, which means it will have a Windows user
interface and run on a desktop computer. Recall that a user interface is what the user sees and
interacts with while an application is running. Windows applications in Visual Basic are
composed of solutions, projects, and files. A solution is a container that stores the projects and
files for an entire application. Although the solutions in this book contain only one project, a
solution can contain several projects. A project also is a container, but it stores only the files
associated with that particular project.
To create a Visual Basic 2012 Windows application: START HERE
1. Click FILE on the menu bar and then click New Project to open the New Project
dialog box.
2. If necessary, expand the Visual Basic node in the Installed Templates list, and then
(if necessary) click Windows.
3. If necessary, click Windows Forms Application in the middle column of the
dialog box.
4. Change the name entered in the Name box to Splash Project.
5. Click the Browse button to open the Project Location dialog box. Locate and then
click the VB2012\Chap01 folder. Click the Select Folder button to close the Project
Location dialog box.
6. If necessary, select the Create directory for solution check box in the New Project
dialog box. Change the name entered in the Solution name box to Splash Solution.
Figure 1-4 shows the completed New Project dialog box in Visual Studio Professional
2012. (Your dialog box will look slightly different if you are using Windows 7 or a
different edition of Visual Studio.) The drive letter may be different from the one shown
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
CHAPTER 1 An Introduction to Visual Basic 2012
in the figure if you are saving to a device other than your computer’s hard drive—for
example, if you are saving to a flash drive.
14
Figure 1-4 Completed New Project dialog box in Visual Studio Professional 2012
7. Click the OK button to close the New Project dialog box. The computer creates a
solution and adds a Visual Basic project to the solution. The names of the solution and
project, along with other information pertaining to the project, appear in the Solution
Explorer window. See Figure 1-5. In addition to the windows shown earlier in Figure 1-2,
three other windows appear in the IDE: Windows Form Designer, Properties, and Data
Sources. (Don’t be concerned if different properties appear in your Properties window.)
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
The Splash Screen Application LESSON A
15
If you want
solution and to size the
Data Sources project names Solution Explorer
window’s tab and information window to match
Figure 1-5,
position your mouse
pointer on the window’s
left border until the
Properties window mouse pointer becomes
a sizing pointer
(a horizontal line with
an arrowhead at each
end), and then drag the
border to either the left
or the right.
Windows Form
Designer window
1. Click the Close button on the Properties window’s title bar to close the window. Now,
click VIEW on the menu bar and then click Properties Window to open the window.
2. If your IDE contains the Team Explorer window, click the Team Explorer tab and then
click the Close button on the window’s title bar.
3. Click the Auto Hide (vertical pushpin) button on the Solution Explorer window. The
Solution Explorer window is minimized and appears as a tab on the edge of the IDE.
4. To temporarily display the Solution Explorer window, click the Solution Explorer tab.
Notice that the Auto Hide button is now a horizontal pushpin rather than a vertical
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
CHAPTER 1 An Introduction to Visual Basic 2012
pushpin. To return the Solution Explorer window to its auto-hidden state, click the
Solution Explorer tab again.
5. To permanently display the Solution Explorer window, click the Solution Explorer tab
and then click the Auto Hide (horizontal pushpin) button on the window’s title bar. The
vertical pushpin replaces the horizontal pushpin on the button.
16 6. If necessary, close the Data Sources window.
7. Figure 1-6 shows the current status of the windows in the IDE. Only the Windows Form
Designer, Solution Explorer, and Properties windows are open; the Toolbox window is
auto-hidden. If necessary, click Form1.vb in the Solution Explorer window. If the items
in the Properties window do not appear in alphabetical order, click the Alphabetical
button.
In the next several sections, you will take a closer look at the Windows Form Designer, Solution
Explorer, and Properties windows. (The Toolbox window is covered in Lesson B.)
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
The Splash Screen Application LESSON A
the designer window is a tab labeled Form1.vb [Design]. Form1.vb is the name of the file (on
your computer’s hard disk or on another device) that contains the Visual Basic instructions
associated with the form, and [Design] identifies the window as the designer window.
form
As you learned in the Overview, all objects in an object-oriented program are instantiated Recall that a
(created) from a class. A form, for example, is an instance of the Windows Form class. The form class is a pattern
that the
is automatically instantiated for you when you create a Windows application.
computer uses
to create an
object.
The Solution Explorer Window
The Solution Explorer window displays a list of the projects contained in the current solution and the
items contained in each project. Figure 1-8 shows the Solution Explorer window for the Splash Solution,
which contains one project named Splash Project. Within the Splash Project are the My Project folder
and two files named App.config and Form1.vb. The project also contains other items, which are
typically kept hidden. However, you can display the additional items by clicking the Show All Files
button. You would click the button again to hide the items. The .vb on the Form1.vb filename indicates
that the file is a Visual Basic source file. A source file is a file that contains program instructions, called
code. The Form1.vb file contains the code associated with the form displayed in the designer window.
You can view the code using the Code Editor window, which you will learn about in Lesson B.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
CHAPTER 1 An Introduction to Visual Basic 2012
The Form1.vb source file is referred to as a form file because it contains the code associated with
a form. The code associated with the first form included in a project is automatically stored in a
form file named Form1.vb. The code associated with the second form in the same project is
stored in a form file named Form2.vb, and so on. Because a project can contain many forms and,
therefore, many form files, it is a good practice to give each form file a more meaningful name.
Doing this will help you keep track of the various form files in the project. You can use the
Properties window to change the filename.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
The Splash Screen Application LESSON A
Categorized button
Object box
Alphabetical button
19
Settings box
Properties list
Description pane
To use the Properties window to change the form file’s name: START HERE
1. Form1.vb should be selected in the Solution Explorer window. Click File Name in the
Properties list and then type Splash Form.vb. Be sure to include the .vb extension on You also can
the filename; otherwise, the computer will not recognize the file as a source file. change the File
Name property
2. Press Enter. Splash Form.vb appears in the Solution Explorer and Properties windows by right-clicking
and on the designer window’s tab, as shown in Figure 1-10. Form1.vb in the
Solution Explorer window
and then clicking Rename
on the context menu.
form file’s name
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
CHAPTER 1 An Introduction to Visual Basic 2012
location of the
form name Form class class name
Figure 1-11 Properties window showing a partial listing of the form’s properties
Notice that Form1 System.Windows.Forms.Form appears in the Object box in Figure 1-11.
Form1 is the name of the form. The name is automatically assigned to the form when the form
is instantiated (created). In System.Windows.Forms.Form, Form is the name of the class used to
instantiate the form. System.Windows.Forms is the namespace that contains the Form class
definition. A class definition is a block of code that specifies (or defines) an object’s appearance
and behavior. All class definitions in Visual Basic 2012 are contained in namespaces, which you
can picture as blocks of memory cells inside the computer. Each namespace contains the code
that defines a group of related classes. The System.Windows.Forms namespace contains the
definition of the Windows Form class. It also contains the class definitions for objects you add to
a form, such as buttons and text boxes.
The period that separates each word in System.Windows.Forms.Form is called the dot
member access operator. Similar to the backslash (\) in a folder path, the dot member access
operator indicates a hierarchy, but of namespaces rather than folders. In other words, the
backslash in the path D:\VB2012\Chap01\Splash Solution\Splash Project\Splash Form.vb
indicates that the Splash Form.vb file is contained in (or is a member of) the Splash Project
folder, which is a member of the Splash Solution folder, which is a member of the Chap01
folder, which is a member of the VB2012 folder, which is a member of the D: drive. Likewise, the
name System.Windows.Forms.Form indicates that the Form class is a member of the Forms
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Properties of a Windows Form LESSON A
1. Drag the scroll box in the Properties window to the top of the vertical scroll bar. As you
scroll, notice the various properties associated with a form. Also notice that the items
within parentheses appear at the top of the Properties list.
2. Click (Name) in the Properties list. Type frmSplash and press Enter. An asterisk (*)
appears on the designer window’s tab. The asterisk indicates that the form has been
changed since the last time it was saved.
1. Scroll down the Properties window until you see the Text property in the Properties list
and then click Text.
2. Type Red Tree Inn and press Enter. The new text appears in the property’s Settings
box and also in the form’s title bar.
The Name and Text properties of a Windows form should always be changed to more
meaningful values. The Name property is used by the programmer when coding the application.
The Text property, on the other hand, is read by the user while the application is running.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
CHAPTER 1 An Introduction to Visual Basic 2012
START HERE To center a form on the screen when the application is started:
1. Click StartPosition in the Properties list and then click the list arrow in the
Settings box.
2. Click CenterScreen in the list.
22
The Font Property
A form’s Font property determines the type, style, and size of the font used to display the text
on the form. A font is the general shape of the characters in the text. Segoe UI, Tahoma, and
Microsoft Sans Serif are examples of font types. Font styles include regular, bold, and italic.
The numbers 9, 12, and 18 are examples of font sizes, which typically are measured in points,
with one point equaling 1 ⁄ 72 of an inch. The recommended font for applications created for
systems running Windows 8, Windows 7, or Windows Vista is Segoe UI because it offers
improved readability. Segoe is pronounced SEE-go, and UI stands for user interface. For most
of the elements in the interface, you will use a font size of 9-point. However, to make the
figures in the book more readable, some of the interfaces created in this book will use a larger
font size.
START HERE To set the form’s Font property:
1. Click Font in the Properties list and then click the … (ellipsis) button in the Settings box
to open the Font dialog box.
2. Locate and then click the Segoe UI font in the Font box. Click 9 in the Size box and then
click the OK button. (Don’t be concerned if the size of the form changes.)
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Saving a Solution LESSON A
To set and then restore the form’s BackColor property value: START HERE
1. Click BackColor in the Properties list and then click the list arrow in the Settings box.
Click the Custom tab and then click a red square to change the background color of the
form to red.
2. Now, right-click BackColor in the Properties list and then click Reset on the context
menu. The background color of the form returns to its default setting. Figure 1-12 shows 23
the status of the form in the IDE.
Saving a Solution
The asterisk (*) that appears on the designer tab in Figure 1-12 indicates that a change was made
to the form since the last time it was saved. It is a good idea to save the current solution every 10
The Save All
or 15 minutes so that you will not lose a lot of your work if the computer loses power. You can button on the
save the solution by clicking FILE on the menu bar and then clicking Save All. You also can click Standard toolbar
the Save All button on the Standard toolbar. When you save the solution, the computer saves looks like this:
any changes made to the files included in the solution. It also removes the asterisk that appears .
on the designer window’s tab.
To save the current solution: START HERE
1. Click FILE on the menu bar and then click Save All. The asterisk is removed from the
designer window’s tab, indicating that all changes made to the form have been saved.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
CHAPTER 1 An Introduction to Visual Basic 2012
Lesson A Summary
l To start Visual Studio 2012:
If you are using Windows 8, tap the Windows logo key (if necessary) to switch to the
Windows 8 tile-based mode and then click the Visual Studio 2012 tile. If you are using
Windows 7, click the Start button on the Windows 7 taskbar, point to All Programs, click
Microsoft Visual Studio 2012, and then click Visual Studio 2012.
l To select a different window layout:
Click TOOLS on the menu bar, click Import and Export Settings, select the Reset all settings
radio button, click the Next button, select the appropriate radio button, click the Next
button, click the settings collection you want to use, and then click the Finish button.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part.
Random documents with unrelated
content Scribd suggests to you:
A RETORT FROM THE CATBIRD
Frances Wright
Once upon a time the owls were the largest and the most dull and
stupid of all the birds of the air. While the eagle soared above the
mountain's crest to hail the sun before his rising, and the lark
carolled his matin in the blue fields of ether, the owls were snoring;
when the thrush and the blackbird, retreating from the heat of noon,
filled the deep groves with their melody, the owls snored out the
sylvan concert; and when the soft cushat poured his evening tale of
love into the ear of his listening mate, the owls were still snoring in
their unbroken and dreamless sleep.
It chanced, most naturally, that when towards midnight, the
heavy, big-headed creatures half-opened their stupid eyes, and half-
stretched first one drowsy pinion and then the other, that their
stomachs craved for food; whereupon, after much yawning and
stretching, they dragged themselves from their holes and went
prowling after bats and mice in the dark. Tired with their hunt, and
not over content with their supper, which was both coarse and
scanty, they thus laid their heads together, and, however dull by
nature, and doubly dulled by sleep, they were for once stimulated by
hunger and disappointment to something like ingenuity.
Said an old gray-headed owl: "This barbarous exercise ill suits with
my years and my gravity."
"And this barbarous fare," said a pert, idle youngster, "ill suits with
the youthful activity of my stomach."
"I'll stake my reputation upon it," said a third, shaking his dull
head, "but that proud, self-sufficient gormandizing eagle has eaten a
whole sheep for his supper."
"And I'll stake mine," yawned a fourth, "that his first cousin, the
vulture, and his second cousin, the hawk, have feasted; the one on
a fat lamb, and the other on a hen and chickens."
"Chut," said the first old grey-beard, "we'll feast ere long on
sheep, lamb, hen, chickens, and all; ay! mayhap on the eagle's own
little ones, to say nothing of his cousins."
"How so," hooted out the whole junto—"you would not fight the
king of birds?"
"Let me alone for that; there are better weapons than beak or
talons; and so he and his subjects shall find. But you must all aid in
the enterprise."
"If there be no fighting, and not too much labour, and not too
much——"
"Peace! there shall be nothing but sleeping!"
"Sleeping?"
"Ay! and some talking. But leave that to me."
Here all the heavy heads poked forward, closing in a circle round
their Nestor; while all their great round eyes opened in full stare
upon his.
"To-morrow you must all sleep as usual, until I give a long hoot;
then you must all open your eyes and observe what shall chance."
Tired with so unusual a debate, all went to sleep accordingly, and
snored louder than usual; until, just as the sun had awakened to full
life and stir all the feathered tribe, the old owl hooted and screeched
forth such a yell, as first terrified and then attracted on wings,
spurred by curiosity, though still trembling with fear, every bird of
the air from the giant eagle to the diminutive wren.
"A vision! a vision!" cried the owl; and again he screeched and
again he hooted, rustling up all his feathers, flapping his wings,
blinking his eyes, and tumbling head over tail like a bird distracted.
Every creature present stared and wondered.
"A vision, a vision! A miracle, a miracle!" again shouted the owl.
"I have seen a bird larger than the ostrich and stronger than the
eagle. Lightnings flame from his eyes, and thunder roars from his
beak. He has spoken; and lo! his command was: The owls are my
servants and to them I make known my will. Let all the birds of the
air hearken to their voice. Let them do their bidding, respect their
repose, and feed them with the fat of the land; or, behold, I will feed
upon them."
Thereupon, the owls set up a hoot in chorus, and all the birds
scattered to the four winds to collect food for the servants to eat,
lest the unseen master should eat them.
From this time forth these stupid owls were deemed the wisest of
the birds of the air; they supped every night upon fat yearlings; and
when they hooted all the feathered tribe clapped their wings and
sang a song of praise.
BIRDS' NESTS
Ernest Ingersoll
Selma Lagerlöf
Hatto, the hermit, stood in the desert and prayed to God. The
storm was on, and his long hair and beard blew about him as wind-
whipped grass blows about an old ruin. But he did not brush back
the hair from his eyes, nor did he fasten his long beard to his girdle,
for his arms were raised in prayer. Since sunrise he had held his
gaunt, hairy arms out-stretched toward heaven, as untiring as a tree
stretching out its boughs, and thus he would remain until evening. It
was a great thing for which he was praying.
He was a man who had suffered much from the wickedness and
dishonesty of the world. He himself had persecuted and tortured
others, and persecution and torture had been his portion, more than
he could endure. Therefore, he had gone forth into the wilderness,
had dug himself a cave on the river bank, and had become a holy
man whose prayers found hearing at the throne of God.
Hatto, the hermit, stood on the river bank before his cave and
prayed the great prayer of his life. He prayed God to send down the
Day of Judgment upon this wicked world. He cried to the angels of
the trumpets, who are to herald the end of the reign of sin.
Round about him was the wilderness, barren and desolate. But a
little up the bank stood an old willow with shortened trunk, which
swelled out at the top of a round hump like a queer head, and from
it new, freshly green twigs were sprouting. Every autumn the
peasants from the unwooded flatlands robbed the willow of her fresh
new shoots. But every year the tree put forth new ones, and on
stormy days the slender, flexible twigs whipped about the old willow,
as hair and beard whipped about Hatto, the hermit.
It was just on this day that a pair of water thrushes, who usually
built their nest on the trunk of the old willow between the new
twigs, had decided to begin their work. But the wild whipping of the
twigs disturbed the birds. They flew up with their bits of dry grass
with nothing accomplished. Then it was that they caught sight of old
Hatto.
No one now living can picture to himself how moss-grown and
dried-up, how gnarled and black and generally unlike a human
being, such an old desert hermit can become. His skin clung so close
to forehead and cheekbones that his head looked like a skull, and
only a tiny gleam down in the depth of his eyeballs showed that
there was still life in him. The dried-up muscles gave no curve to the
body; the outstretched naked arms were merely a couple of narrow
bones, covered with hard, wrinkled, bark-like skin. He wore an old
black cloak, clinging close to his body. He was tanned brown by the
sun and black with dirt. His hair and beard alone were of a lighter
shade, for rain and sunshine had faded them to the grey-green hue
of the under side of willow leaves.
The birds, flying about uneasily and seeking a place for their nest,
took Hatto the hermit to be another old willow cut off by axe and
saw in its heavenward striving. They flew about him many times,
flew away and returned again, took note of the guide posts on the
way to him, calculated his position in regard to protection from
storm and birds of prey, found it rather unfavourable, but decided to
locate there on account of the close vicinity of the stream and the
reeds, their chief source of supply. One of the birds shot down
suddenly and laid a bit of grass in the hermit's outstretched hand.
The storm had abated a little, so that the straw was not blown
from his hand at once, but the hermit did not pause in his prayer,
"Come soon, O Lord, come to destroy this world of sin, that mankind
may not more increase its load of guilt."
The storm roared out again, and the bit of grass fluttered out of
the hermit's great bony hand. But the birds came again and
endeavoured to erect the cornerstone of their new home between
his fingers. Suddenly a dirty, clumsy thumb laid itself over the grass
spears and held them in firm position, while four fingers reached
over the palm, making a peaceful niche where a nest would be safe.
The hermit continued his untiring supplications, and before his eyes
danced fever visions of the day of judgment. The earth trembled,
the skies shot fire. He saw the black clouds of hurrying birds
beneath the glowing firmament; herds of fleeing animals spread
over the earth. But while his soul was filled with these visions of
fever, his eyes began to watch the flight of the tiny birds that came
and went with lightning dashes, laying new straws in the nest with
little chirps of pleasure.
The old man did not move. He had made a vow to stand the
entire day with outstretched arms, in order to force God to hear him.
The little thrushes built and built busily all the day, and their work
progressed finely. There was no lack of material in this wilderness of
rolling ground with stiff grass and brush, and on the river bank, with
its reeds and rushes. They could not take time for dinner or supper.
They flew back and forth, glowing with interest and pleasure, and
when dusk came they had reached the peak of their roof.
But before evening fell the hermit's eyes had come to rest on their
labour more and more. He watched them in their flight; he scolded
them when they were clumsy; he grieved when the wind spoiled
their efforts, and he became almost angry when they stopped a
moment to rest.
Then the sun sank and the birds sought their accustomed resting
place among the reeds, safe from all harm, for no enemy could
approach without a warning splash of the water or a quivering of the
reeds.
When the morning broke, the thrushes thought at first that the
events of the preceding day had been but a beautiful dream.
They found their guideposts and flew straight to their nest, but
the nest had disappeared. They peered out over the moors and flew
high up to gain a wider view. But there was no sign of nest or tree.
Finally they sat down on a stone by the water and thought the
matter over. They wagged their tails and turned their heads to right
and left. Where were nest and tree?
But scarcely had the sun raised itself a hand's breadth over the
belt of woods beyond the stream, when their tree suddenly came
wandering up and stood itself upon the selfsame place it had
occupied the day before. It was as black and as gnarled as before,
and it carried their nest on the tip of something that was probably a
thin, upright bough.
The birds began to build again without attempting to ponder
further over the many miracles of nature.
Hatto, the hermit, who chased the little children from his cave and
told them it were better for them if they had never seen the light of
day; he who waded out deep into the mud of the river to hurl curses
after the flagged boats filled with gay young people rowing past; he
from whose evil glance the shepherds carefully guarded their flocks,
he did not return to his place on the river bank because of thought
for the little birds. But he knew that not only every letter in the Holy
Book has its own mystical meaning, but that everything that God
allows to happen in the natural world has its significance also. And
he had discovered what it might mean, this sign of the birds building
in his hand: God had willed that he should stand with outstretched
arm until the birds had raised their young—could he do this, then
would his prayer be heard.
But on this day his glance followed the motions of the birds with
greater attention. He saw the rapid completion of the nest. The tiny
builders flew around it and examined it carefully. They brought a few
rags of moss from the real willow and plastered them on the outside
as a finishing decoration. They brought the softest young grass, and
the female bird pulled the down from her breast to furnish the
inside.
The peasants of the neighbourhood, who feared the evil power
which the prayers of the hermit might have with God, were used to
bring him bread and milk to soften his anger. They came now, and
found him standing motionless, the bird's nest in his hand.
"See how the holy man loves the little creatures," they said, and
feared him no longer. They raised the milk can to his lips and fed
him with the bread. When he had eaten and drunk he drove them
away with curses, but they smiled at his anger.
His body had long since become the servant of his will. He had
taught it obedience by hunger and scourge, by days of kneeling and
sleepless nights. Now his muscles of steel held his arm outstretched
days and weeks, and while the mother bird sat on her eggs and did
not leave the nest, he would not go to his cave even to sleep at
night. He learned how to sleep standing with outstretched arm.
He grew accustomed to the two uneasy little eyes that peered
down at him over the edge of the nest. He watched for rain and hail,
and protected the nest as well as he could.
One day the little mother left her place. Both thrushes sat on the
edge of the nest, their tails moving rapidly, holding great
consultation and looking very happy, although the whole nest
seemed filled with a frightened squeaking. After a little they set out
upon an energetic gnat hunt.
One gnat after another fell before them, and was brought home to
that which squeaked and peeped up there in his hand. And the
peeping grew more intense whenever the food was brought in. It
disturbed the holy man at his prayers. Gently, very gently, his arm
sank down on the joints that had almost lost the power of motion,
until his deep-set, glowing eyes peered into the nest.
Never had he seen anything so ugly and so miserable—naked little
bodies, with a few scattered down tufts, no eyes, no strength to fly,
nothing but six great open beaks.
He could not understand it himself, but he liked them just as they
were. He had not thought to make an exception of the old birds in
his prayers for the great Doom, but when he now implored God to
release the world through utter destruction, he made a silent
exception in favour of these six little helpless creatures.
When the peasant women brought him food he no longer
rewarded them with curses. As he was necessary for the little ones
up there in his hand, he was glad that the people did not let him
starve.
Soon six little round heads peered all day over the edge of the
nest. Old Hatto's arm sank to the level of his eyes more and more
frequently. He saw the feathers grow out of the red skin; he saw the
eyes open and the little bodies round out. The fortunate inheritance
of all the beauty with which nature endows the feathered denizens
of the air came early into their heritage.
And, meanwhile, the prayers for the great destruction came more
and more slowly from Hatto's lips.
He believed he had God's promise that it should come as soon as
the little birds were able to fly. And now he stood there seeking an
escape from God. For he could not sacrifice these six little ones,
whom he had watched and cared for.
It had been different before, when he had had nothing of his own
to care for. Love of the small and the helpless—that love which every
little child must teach to the dangerous grown man—this love came
over him and made him hesitate.
Sometimes he wished that he could throw the entire nest into the
stream, for he still believed that those alone are to be envied who
die without having known care or sin. Was it not his duty to save
these little ones from beasts of prey, from cold and hunger and all of
the many ills of life? But just as he was pondering on this, a hawk
swooped down on the nest to kill the little ones. Hatto caught the
robber in his left hand, whirled him around his head, and threw him
far out into the stream.
Then came the day when the little ones were ready to fly. One of
the old birds sat inside the nest, trying to push the young ones out
on the edge, while the other flew about and showed them how easy
it was if they would only try. But as the young ones would not
overcome their fear, both old birds flew out before them, showing off
all their prettiest arts and tricks. They turned and twisted in the air,
they shot up straight as does the lark, or they hung motionless on
rapidly fluttering wings.
But the little ones would not move, and then Hatto decided to
interfere in the matter himself. He gave them a careful push with
one finger, and thus ended the dispute. They tumble out, trembling
and uncertain, hitting at the air as bats do; they sink down, but rise
up again; they find the proper motion and use it at once to regain
the nest. The old birds come back to them in happy pride, and Hatto
chuckles.
It was he who had brought the matter to such a happy conclusion.
And now he pondered most seriously the question as to whether a
loophole of escape could be found for God.
Perhaps, when one comes to think of it, God holds this earth like a
bird's nest in His right hand and perhaps He loves those within it—all
the helpless children of earth. Perhaps He is merciful to them whom
He had vowed to destroy, just as the hermit was merciful to the little
birds. Of course the hermit's birds were much better than God's
human beings, but he could still understand that God might have
pity for them in His heart.
Next day the nest was empty, and the bitterness of loneliness
came over the hermit. His arm sank slowly down at his side, and it
seemed to him that all nature held its breath to hear the roar of the
trumpets announcing the Last Judgment. But in the same moment
all the birds returned and settled down on his head and shoulders,
for they had no fear of him. And a light shot through the tortured
brain of the old hermit. He had lowered his arm every day to look at
the birds.
And then, as he stood there, the six young birds flying about him,
he nodded, smiling, to some one whom he could not see.
"Thou art free," he said. "Thou art free. I did not keep my vow,
therefore Thou needst not keep Thine."
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
ebookbell.com