Example: barber

V i s u a l B a s i c 2 0 1 9 M a d e E a s y - vbtutor.net

Visual Basic 2019 Made Easy By Disclaimer Visual Basic 2019 Made Easy is an independent publication and is not affiliated with, nor has it been authorized, sponsored, or otherwise approved by Microsoft Corporation. Trademarks Microsoft, Visual Basic, excel and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. All other trademarks belong to their respective owners. Liability The purpose of this book is to provide basic guides for people interested in Visual Basic 2019 programming . Although every effort and care has been taken to make The information as accurate as possible, the author shall not be liable for any error, Harm or damage arising from using the instructions given in this book. Copyright 2019 Liew Voon Kiong All rights reserved. No Part of this e-book may be reproduced in any form or by any means, without permission in writing from the author.

Visual Basic programming for more than 20 years. He created the popular online ... Visual Basic 2017 Made Easy and Excel VBA Made Easy. Dr. Liew’s books have been used in high school and university computer science courses all over the world. ... 9.2.9 The Ucase and the Lcase Functions 92 9.2.10 The Chr and the Asc functions 92 Example 9.8 ...

Tags:

  Programming, Excel, Functions, Excel vba

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of V i s u a l B a s i c 2 0 1 9 M a d e E a s y - vbtutor.net

1 Visual Basic 2019 Made Easy By Disclaimer Visual Basic 2019 Made Easy is an independent publication and is not affiliated with, nor has it been authorized, sponsored, or otherwise approved by Microsoft Corporation. Trademarks Microsoft, Visual Basic, excel and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. All other trademarks belong to their respective owners. Liability The purpose of this book is to provide basic guides for people interested in Visual Basic 2019 programming . Although every effort and care has been taken to make The information as accurate as possible, the author shall not be liable for any error, Harm or damage arising from using the instructions given in this book. Copyright 2019 Liew Voon Kiong All rights reserved. No Part of this e-book may be reproduced in any form or by any means, without permission in writing from the author.

2 Acknowledgement Iwouldliketoexpressmysinceregratitudetot hemanypeoplewhohavemadetheir contributions in one way or another to the successful publication of this book. MyspecialthanksgotomychildrenXiang,Yiand Xunwhohavecontributedtheir alsoliketothankthemillionsofreaderswhoha vevisitedmy VisualBasicTutorial website at for their support and encouragement. About the Author sdegreeinMathematics,amaster sdegreein VisualBasicTutorialat ,whichhasattractedmillionsofvisitors since 1996. It has consistently been one of the highest ranked Visual Basic websites. ToprovidemoresupportforVisualBasicstuden ts,teachers,andhobbyists, haswrittenthisbooktocomplementthefreeVis ualBasic2019tutorialwithmuch ,which includes VisualBasic6 MadeEasy,VisualBasic2008 MadeEasy,VisualBasic 2010 MadeEasy,VisualBasic2013 MadeEasy,VisualBasic2015 MadeEasy, VisualBasic2017 MadeEasy and ExcelVBAMadeEasy.

3 Sbookshave been used in high school and university computer science courses all over the world. Table of Contents Chapter 1 Introduction14 A Brief History of Visual Basic14 Installation of Visual Studio 201914 Creating a Visual Basic 2019 Project17 Chapter 2 Designing the User Interface25 Customizing the Form25 Example Changing Properties at Runtime28 Example Customizing the Form29 Adding Controls to the Form30 Chapter 3 Writing the Code35 The Concept of Event-Driven Programming35 Writing the Code36 Example Displaying a Message37 Example Arithmetic Calculations38 Chapter 4 Working with Controls39 TextBox39 Example Adding two numbers39 Label40 Example Display output on a Label41 ListBox42 Adding Items to ListBox42 Example Adding an Item to ListBox43 Example Adding Items using InputBox44 Example Geometric Progression45 Removing Items from a List Box47 Example Removing Items from ListBox47 Example

4 Removing an Item from ListBox via an Input Box48 Example Delete a Selected Item from ListBox49 Example Delete Multiple Selected Items from ListBox51 Example Clear All Items from ListBox51 ComboBox52 Adding Items to ComboBox52 Example Adding an Item to ComboBox54 Example Adding an Item to ComboBox via an Input Box54 Removing Items from a Combo box55 Example Delete an Item from ComboBox56 Example Delete a Selected Item from ComboBox56 Example Remove All Items from ComboBox56 Chapter 5 Handling Images57 Loading an Image in a Picture Box57 Loading an Image at Design Time57 Loading an Image at Runtime60 Example Loading an Image at Runtime60 Loading an Image using Open File Dialog Control60 Example Loading an Image via a Dialog Box61 Chapter 6 Working with Data64 Visual Basic 2019 Data Types64 Numeric Data Types64 Non-numeric Data Types65 Suffixes for Literals66 Variables and Constants67 Variable Names67 Declaring Variables68 Example Declaring Variables68 Example Declaring a String Variable69 Example Declaring a Fixed Length String Variable70 Assigning Values to Variables70 Example Assigning Values to Variables70 Example Error Assigning a Variable71 Scope of Declaration71 Declaring Constants72 Example Declaring Constants72 Example Computing the Area of a Circle72 Chapter 7 Arrays74 Introduction to Arrays74 Dimension of an Array74 Declaring Arrays75 Example To Find the Length of an Array76 Example Find the length of Non-zeroth Array76 Example Declaring Two-Dimensional Array77 Example Creating an Array via an Input Box77 Chapter 8 Mathematical Operations80 Mathematical Operators80 Writing Code that Performs

5 Mathematical Operations80 Example Standard Arithmetic Calculations81 Example Performing Arithmetic Operations81 Example Pythagorean Theorem81 Example : BMI Calculator82 Chapter 9 String Manipulation84 String Manipulation Using + and & signs84 Example Concatenation of Strings84 Example Data Mismatch85 String Manipulation Using Built-in Functions87 The Len Function87 Example Using the Len Function to find the Lenth of a Phrase87 The Right Function88 Example Extracting the Right Portion of a Phrase88 The Left Function88 The Mid Function89 Example Using the Mid Function to Extract a Part of a Phrase89 Example Extracting a Part of a Phrase89 Trim Function90 Example Trimming a Phrase91 Ltrim Function91 The Rtrim Function91 The InStr function91 The Ucase and the Lcase Functions92 The Chr and the Asc functions92 Example Boggle94 Chapter 10 Using Conditional Operators97 Logical Operators98 Using If.

6 If ..Then Statement98 Example Using Statement99 Statement99 Example Lucky Draw Simulation100 Example Another Lucky Draw Program102 Statement105 Example Grade Generator105 Chapter 11 Select Case108 Example : Examination Grades108 Example Using Case Is110 Example Select Case for a Range of Values111 Example Computing Exam Grades112 Chapter 12 Looping114 Loop114 Example Adding Numbers to a List Box114 Example Summation of Numbers using a For Next Loop115 Example Negative Increment in a For Next Loop116 Example Exit For117 Do Loop118 Example Adding Numbers in a Do Loop119 Example Adding Numbers in a Do Loop120 While Loop121 Example Summation of Numbers using a While End While Loop121 Chapter 13 Sub Procedures123 Example A Sub Procedure that Add Two Numbers123 Example : Password Cracker124 Chapter 14 Functions127 Creating a User-Defined Function127 Example : BMI Calculator127 Example.

7 Future Value Calculator128 Passing Arguments by Value and by Reference130 Example Square Root Function131 Chapter 15 Mathematical Functions134 The Abs Function134 Example Computing Absolute Value134 The Exp function135 Example Compute Exponential Value135 The Fix Function136 Example Using Fix136 The Int Function137 The Log Function137 Example The Log Function137 The Rnd( ) Function138 Example Generating Random Integers138 The Round Function139 Example Rounding Numbers139 Chapter 16 The Format Function141 Format Function for Numbers141 Built-in Format function for Numbers141 Example Formatting Numbers142 User-Defined Format143 Example Using User-Defined Formats144 Formatting Date and Time145 Formatting Date and time using predefined formats145 Example Formatting Date and Time145 Formatting Date and time using user-defined formats146 Example Formatting Date and Time with User-Defined Format147 Chapter 17 Checkbox and Radio Button149 Checkbox149 Example.

8 Online Shopping Mall149 Example Shopping Cart151 Example Formatting Fonts152 Radio Button154 Example Shopping Cart with Radio Buttons154 Example Multiple Selections Using Groupbox156 Chapter 18 Errors Handling159 Using On Error GoTo Syntax159 Example Division Errors160 Using ..End Try Structure161 Example Data Types Mismatch Errors162 Chapter19 Object-Oriented Programming164 Concepts of Object-Oriented Programming164 (a) Encapsulation164 (b) Inheritance164 (c) Polymorphism164 Creating a Class165 Example BMI Class166 Example Examination Class169 Example Future Value Class171 Chapter 20 Creating Graphics173 Introduction to Graphics Creation173 Creating the Graphics Object173 Creating the Pen Object174 Drawing a Straight Line174 Drawing Lines that Connect Multiple Points176 Example Drawing straight lines that connect multiple points177 Drawing a curve that Connect Multiple Points178 Example Drawing a Curve179 Drawing a Quadratic Curve180 Example Drawing the Quadratic180 Drawing a Sine Curve182 Example Drawing a Sine Curve183 Drawing a Rectangle184 Customizing Line Style of the Pen Object186 Example Drawing a Rectangle with Dash Line Border186 Drawing an Ellipse187 Example Drawing an Ellipse188 Example Drawing Ellipse with DrawEllipse Method189 Drawing a

9 Circle190 Example Drawing a Circle190 Drawing Text190 Example Drawing Text192 Example Drawing Text193 Drawing Polygons194 Example Drawing a Triangle195 Example Drawing a Quadrilateral196 Drawing a Pie197 Example Drawing a pie that sweeps clockwise through 60 Filling Shapes with Color199 Drawing and Filling a Rectangle with Color199 Example Drawing a Square199 Drawing and Filling an Ellipse with Color201 Example Drawing an Ellipse and Color it201 Drawing and Filling a Polygon with Color202 Example Drawing a Polygon and Color It202 Drawing and Filling a Pie203 Example Drawing a Pie and Color It203 Chapter 21 Using Timer204 Example Creating a Digital Clock205 Example Creating a Stopwatch206 Example Creating a Digital Dice207 Chapter 22 Creating Animation210 Example Creating a Moving Object210 Example Creating a Graphical Dice211 Example Creating a Slot Machine214 Chapter 23 Working with Databases217 Introduction to Database217 Creating a Database Application217 Creating a Connection to a Database using Populating Data in Example Creating a Customer Contact List229 Browsing Records231 Editing, Saving, Adding and Deleting Records232 Example Browsing the Database233 Accessing Database using DataGridView237 Example Browsing Data Using DataGridView237 Performing Arithmetic Calculations in a Database238 Example Performing Arithmetic Calculations in a Database239 Example Calculating Income241 Example Using the Count Function243 Chapter 24 Reading and Writing Text Files245 Reading a Text File245 Writing to a Text File249 Chapter 25 Building Console Applications252 Introduction252 Example.

10 Displaying a Message254 Creating a Text File Writer in Console255 Example Creating a Text File Writer255 Creating a Text File Reader in Console256 Example Creating a Text File Reader256 Creating a Console App using Example Arithmetic Console App257 Chapter 26 Creating Menu Bar and Toolbar260 Creating Menu Items on the Menu Bar260 Creating the Toolbar269 Chapter 27 Deploying your VB 2019 Applications274 Index279 Chapter 1 Introduction A Brief History of Visual Basic VisualBasicisathird-generationevent-driv enprogramminglanguagefirstreleased favor VB6 over its successor In2002, ( )toreplaceVisualBasic6. Thereafter,MicrosoftdeclaredVB6alegacypr ogramminglanguagein2008. However, createdtocaterforthedevelopmentoftheweba swellasmobileapplications.


Related search queries