
Résumé
Kris Jamsa's Starting with Microsoft Visual Basic is your guide to learning, running, and working with Visual Basic. You'll start with the basics by learning how to install Visual Basic, create your first program, and make Visual Basic work for you. You'll then progress into more advanced topics, building on each lesson. From creating and improving programs to handling program errors, this book includes all of the information you will need to learn and utilize Visual Basic!
Use this book as a guide to:
- Install and run Visual Basic
- Understand subroutines and functions
- Use loops, forms, and modules
- Create and display graphics
- Add sound and multimedia
- Use menus, statusbars, progressbars, and toolbars
- Print within a Visual Basic program
- Handle program errors
- Build Active X® and OLE components
- Package your program
Contents Part I Basics and Fundamentals
Lesson 1 Installing Visual Basic
Revisiting the Chicken and Egg Problem
Using Visual Basic Features
Visual Basic Integrated Development Environment
Contrasting Design Time and Runtime
Installing Visual Basic
What You Must Know
Lesson 2 Creating Your First Visual Basic
Program
Starting Visual Basic
Selecting a Project Type Working in the Visual Basic
Environment
Saving Your Visual Basic Program to Disk
Loading Your Visual Basic Program from Disk
Improving Your Program
Creating an Executable Program
What You Must Know
Lesson 3 Using Variables and Constants
Understanding Constants
Using Enumeration to Group Values
Using Variables to Store Information
Using Variables within Math Operations
Understanding Visual Basic's Mathematical Operators
Understanding Operator Precedence
Test-Driving a Variables Example
What You Must Know
Lesson 4 Understanding String Functions
Introduction to Strings
Concatenation
Understanding String Segmenting
Searching within a String
Determining a String's Length
Replacing One String or Substring with Another
Understanding Case-Sensitivity
The StringStrung Example
What You Must Know
Lesson 5 Understanding Subroutines and
Functions
Understanding Good Coding Practices
Taking a Look at the "ZapSoft Company" Experience
Understanding the Value of Comments
Adding More Green (the Visual Basic Comment Color) to Your
Programs
Commenting by Block
Taking a Look at Comment Styles
Using Whitespace to Make Your Code Easier to Read
Building Reusable Routines
Understanding the Difference between Subs and
Functions
Using Arguments in Subs and Functions
What You Must Know
Lesson 6 Making Decisions within Your
Programs
Introducing Conditional Programming
Using the Else Statement
Using the Elself Statement
Using Select Case Structures
Understanding Is, To, and Comparison Operators
Building the MiniCalc Example Program
What You Must Know
Lesson 7 Using Message Boxes
Understanding Message Boxes
Comparing Modal and Modeless Message Boxes
Creating Message Boxes
Passing Arguments to MsgBox
Working with MsgBox Return Values
Building a Few MsgBox Examples
Getting User Input
What You Must Know
Lesson 8 Using Text Boxes
Introducing Text Boxes
Creating Text Boxes
Sizing a Text Box
Placing a Text Box
Copying a Text Box
Understanding Text Box Naming Conventions
Controlling Text Box Appearance
Getting User Input
Limiting Text Box Length
Using a Text Box for Passwords
Controlling the Text Box
Creating a Multiple Line Text Box
Using Scrollbars to Reveal Text Box Text
Understanding the RichTextBox Control
Creating a RichTextBox
What You Must Know
Lesson 9 Using List Boxes
Introducing the ListBox Control
Creating a List Box
Adding Items to a List Box
Deleting Items from a List Box
Counting Items in a List Box
Using Advanced List Box Features
Sorting a List Box
Defining Columns within a List Box
Selecting Multiple List Box Items
Using Checkboxes in a List Box
Using the ComboBox Control
What You Must Know
Lesson 10 Using Loops to Repeat One or More
Instructions
Introducing Loops
Using the For-Next-Loop to Repeat Instructions a Specific
Number of Times
Using the For Each-Next Loop
Understanding the Do-Loop Family
Generating Random Numbers
Looking at the Loopy Example
What You Must Know
Lesson 11 Working with Timers, Time, and
Dates
Understanding the Use and Purpose of Timers
Adding a Timer Control
Setting Time Intervals
Looking at the MyTime Example
Understanding Event-Driven Code
Using Timers to Decrease CPU Usage
Working with Time and Dates
What You Must
Lesson 12 Using Forms and Modules
Understanding the Difference between Forms and
Modules
Creating Multiple Forms
Switching between Forms
Understanding the Public and Private Keywords
Hiding Forms
Disabling Forms
Creating Modules
Modules and Code Readability
Reusing Forms and Modules
What You Must Know
Lesson 13 Understanding Classes
Introducing Classes
Creating User-Defined Types
Understanding Scope within Classes
Building Reusable Classes
Creating Classes
Creating Methods within Classes
Creating Classes Using the Class Builder Wizard
Using Classes
Embellishing Class Routines
What You Must Know
Lesson 14 Creating and Displaying Graphics
Using the With-End with Block
Understanding Coordinates in Visual Basic
Assigning Colors within Visual Basic
Creating Primitive Graphics
Locating Yourself Using CurrentX and CurrentY
Understanding Line Control
Understanding Shape Control
Looking at the Palette Power Example
What You Must Know
Lesson 15 Using Icons, Picture Boxes, and Image
Controls
Changing the Program Icon
Using the PictureBox Control
Using the Image Control
Using the PaintPicture Method
Creating the Ministry of Silly Walks Animation
Example
What You Must Know
Lesson 16 Adding Sound and Multimedia
Generating Sound Using the Beep Statement
Using the Multimedia Control
Playing .wav Files
Playing an Audio CD
Playing .avi Files
Using the Animation Control
What You Must Know
Lesson 17 Working with Mouse and Keyboard
Understanding Cursors and Pointers
Changing the Appearance of the Mouse Cursor
Changing the Mouse Cursor for Different Objects
Customizing the Mouse Cursor
Changing the Position of the Mouse Cursor
Understanding Common Mouse Events
Using the KeyPress Event
Using the KeyUp and KeyDown Events
Using the KeyPreview Property
What You Must Know
Lesson 18 Common Dialogs
Usage and Purpose of Common Dialogs
Adding the CommonDialog Component
Using the Show Methods
Setting Flags
Catching the Cancel Button
Common Dialog Error Constants
The Open and Save as Common Dialog Boxes
The Print Dialog Box
The Font Dialog Box
What You Must Know
Lesson 19 Unleashing Fonts
Introducing Fonts
Contrasting Serif and Sans-Serif Fonts
Presetting Fonts within Controls
Changing Fonts Using Code
Understanding the FontTransparent Property
Handling Unicode Characters and Fonts
Displaying Multiple Fonts
Displaying Multiple Font Sizes
What You Must Know
Lesson 20 Using Menus
Introducing Menus Opening the Menu Editor
Selecting Menu Names and Captions
Creating Menu Titles and Menu Items
Changing the Order of Menu Items
Creating Multiple Menus
Inserting Separator Bars in Your Menus
Inserting, Disabling, and Deleting Menu Items
Assigning Code to Menu Items
Using the Keyboard with Menus
Using Check Marks in Menus
Creating Submenus
Dynamically Changing Menus at Runtime
Using Pop-up Menus
What You Must Know
Lesson 21 Using StatusBars, ProgressBars, and
Toolbars
Adding the Common Controls Component
Using the StatusBar Control
Setting the Style of Panels
Changing a StatusBar's Style
Using the ProgressBar Control
Using the Toolbar Control
Setting Toolbar Button Styles
Changing Toolbars at Runtime
What You Must Know
Lesson 22 Using Sliders and Scrollbars
Understanding Scrollbars
Creating the ScrollPic Example Program
Working with Flat ScrollBars
Understanding Sliders
What You Must Know
Lesson 23 Using Frames and Tabs
Understanding OptionButton and CheckBox Controls
Understanding the Use and Purpose of Frames
Using Frames
Using the Forms 2.0 Frame Control
Adding TabStrips
Assigning General Settings
Adding Tabs at Design Time
Using the TabStrip
Using the Tabbed Dialog Control (SSTabs)
What You Must Know
Lesson 24 Using ImageLists and TreeViews
Understanding the Use and Purpose of the ImageList
Control
Adding Images to an ImageList Control
Using the ImageList Control from Code
Creating Composite Images Using the Overlay Method
Using TreeViews
Building the Room with a TreeView Program
Adding Nodes to a TreeView
Changing the Appearance of Nodes
Using CheckBoxes with TreeViews
Understanding Node Selection and Visibility
Preventing Node Editing
What You Must Know
Lesson 25 Using Files to Store and Retrieve
Information
Opening and Saving Files
Copying, Moving, and Deleting Files
Working with File Attributes
Using DriveListBox, DirListBox, and FileListBox
Working with Folders and Drives
Building the FileMaster Example Program
What You Must Know
Lesson 26 Printing within a Visual Basic
Program
Printing in Visual Basic
Using the PrintForm Method
Setting the Printer Object
Using the Printer Object
Adding Graphics to the Printer Object
Placing Text and Graphics Precisely
Printing to a Non-Default Printer
What You Must Know
Lesson 27 Using Arrays and Collections
Understanding the Purpose of Arrays
Declaring Arrays Using the Dim Statement
Declaring Multi-Dimensional Arrays
Declaring Arrays Using the Array Function
Setting the Array Bounds
Creating Dynamic Arrays
Using the ReDim Statement
Copying Dynamic Arrays
Creating Collections
Adding Items to Collections
Removing Items from Collections
Referencing and Counting Collection Items
Building Collections and Classes
What You Must Know
Lesson 28 Handling Program Errors
Understanding the Importance of Error Handling
Checking for Existence
Using the Err Object
Creating an Error Handling Trap
Understanding Inline Error Handling
Centralizing Error Handling
Handling Math Errors
Handling Printer Errors Asserting Code
Disabling Error Handling
What You Must Know
Lesson 29 Using Help Files
Understanding the Importance of Providing Help
Adding WinHelp Files
Adding HTML Help Files
Adding F1 Help
Adding ToolTips
Adding Tip of the Day Help
Adding WhatsThisHelp
What You Must Know
Lesson 30 Building ActiveX and OLE
Components
Understanding ActiveX and OLE Basics
Using the OLE Container Control
Understanding Automation
Choosing between ActiveX EXE and ActiveX DLL Projects
Creating an ActiveX Control
What You Must Know
Lesson 31 Declaring Application Programming
Interfaces (APIs)
Introducing Application Programming Interfaces (APIs)
Declaring API Calls in Your Programs
Using the API Text Viewer
Discovering Further API Calls
Using the Sleep API Call
Using the GetUserName API Call
Using the GetComputerName API Call
Using API Calls to Handle Services
What You Must Know
Lesson 32 Using Active Directory
Introducing the Active Directory
Using Active Directory from Visual Basic
Accessing Computers with Active Directory
Accessing Users with Active Directory
Accessing Groups with Active Directory
Accessing Microsoft Exchange with Active Directory
What You Must Know
Lesson 33 Winsock and Networking
Understanding Basic Network Communication Concepts
Adding a Winsock Control
Using the User Datagram Protocol (UDP)
The SuperChat Example Program
Using the Transmission Control Protocol (TCP)
Using the Systeminfo Agent Example Program (Server)
Building the Systeminfo Controller Example Program
(Client)
What You Must Know
Lesson 34 Using Graphs and Charts
Using the Microsoft Chart Control
Understanding Chart Type Variations
Using the Property Pages Dialog
Working with Rows and Columns
Using a Legend
Setting a Chart Title
Copying Charts
Working with Manual Data
Dynamic Rotation of Graphs and Charts
Using Arrays for Chart Data
Working with Pie Charts
What You Must Know
Lesson 35 Packaging the Program
Using the Package and Deployment Wizard
Using the Visual Studio Installer 1.1
Where Do You Go From Here?
What You Must Know
Appendix A Related
Material
Appendix B Keycode Constants
Index
Caractéristiques techniques
PAPIER | |
Éditeur(s) | Prima Publishing |
Auteur(s) | Rob Francis |
Parution | 01/06/2001 |
Nb. de pages | 547 |
Format | 18,7 x 23,2 |
Couverture | Broché |
Poids | 958g |
Intérieur | Noir et Blanc |
EAN13 | 9780761532385 |
Avantages Eyrolles.com
Consultez aussi
- Les meilleures ventes en Graphisme & Photo
- Les meilleures ventes en Informatique
- Les meilleures ventes en Construction
- Les meilleures ventes en Entreprise & Droit
- Les meilleures ventes en Sciences
- Les meilleures ventes en Littérature
- Les meilleures ventes en Arts & Loisirs
- Les meilleures ventes en Vie pratique
- Les meilleures ventes en Voyage et Tourisme
- Les meilleures ventes en BD et Jeunesse