| | | Copyright |
| | | Preface |
| | | | Why Another Visual Basic Book? |
| | | | Who This Book Is For |
| | | | How This Book Is Structured |
| | | | About the Third Edition |
| | | | Using Code Examples |
| | | | Conventions Used in This Book |
| | | | Safari® Enabled |
| | | | How to Contact Us |
| | | | Acknowledgments |
| | | Part I: The Basics |
| | | | Chapter 1. Introduction |
| | | | Section 1.1. Why Visual Basic .NET? |
| | | | Section 1.2. What Is Visual Basic .NET? |
| | | | Section 1.3. What Can You Do with Visual Basic .NET? |
| | | | Section 1.4. Versions of Visual Basic for .NET |
| | | | Chapter 2. The .NET Framework: General Concepts |
| | | | Section 2.1. Common Language Runtime |
| | | | Section 2.2. Managed Code |
| | | | Section 2.3. Namespaces |
| | | | Section 2.4. Types and Objects |
| | | | Section 2.5. Assemblies |
| | | | Section 2.6. The Framework Class Library |
| | | | Section 2.7. Application Deployment |
| | | | Section 2.8. The .NET Framework and Visual Basic |
| | | | Chapter 3. Introduction to Object-Oriented Programming |
| | | | Section 3.1. Principles of Object-Oriented Programming |
| | | | Section 3.2. OOP Development in Visual Basic |
| | | | Chapter 4. Variables and Data Types |
| | | | Section 4.1. Data Types |
| | | | Section 4.2. Variables |
| | | | Section 4.3. Constants |
| | | | Section 4.4. Enumerations |
| | | | Section 4.5. Arrays |
| | | | Section 4.6. Collections |
| | | | Section 4.7. Parameters and Arguments |
| | | | Chapter 5. Operators |
| | | | Section 5.1. Arithmetic Operators |
| | | | Section 5.2. Concatenation Operators |
| | | | Section 5.3. Logical and Bitwise Operators |
| | | | Section 5.4. Assignment Operators |
| | | | Section 5.5. Comparison Operators |
| | | | Section 5.6. Object Operators |
| | | | Section 5.7. Operator Overloading |
| | | | Section 5.8. Operator Precedence |
| | | | Chapter 6. Program Structure |
| | | | Section 6.1. Visual Studio Application Types |
| | | | Section 6.2. Referencing Components and Classes |
| | | | Section 6.3. Application Entry Points |
| | | | Section 6.4. Code File Contents |
| | | | Section 6.5. The Structure of a Visual Basic Program |
| | | | Chapter 7. The .NET Framework Class Library |
| | | | Section 7.1. The System Namespace |
| | | | Section 7.2. The System.Collections Namespace |
| | | | Section 7.3. The System.Data Namespace |
| | | | Section 7.4. The System.IO Namespace |
| | | | Section 7.5. The System.Text.RegularExpressions Namespace |
| | | | Section 7.6. The System.Windows.Forms Namespace |
| | | | Section 7.7. Other Namespaces |
| | | | Chapter 8. Delegates and Events |
| | | | Section 8.1. Delegates |
| | | | Section 8.2. Events and Event Binding |
| | | | Chapter 9. Attributes |
| | | | Section 9.1. Syntax and Use |
| | | | Section 9.2. Defining a Custom Attribute |
| | | | Section 9.3. Using a Custom Attribute |
| | | | Chapter 10. Generics |
| | | | Section 10.1. What Are Generics? |
| | | | Section 10.2. Type Parameters |
| | | | Section 10.3. Multiple Type Parameters |
| | | | Section 10.4. Constraints |
| | | | Section 10.5. Multiple Constraints |
| | | | Section 10.6. Accessing Type Parameter Members |
| | | | Section 10.7. Generic Methods |
| | | | Section 10.8. Nested Generic Types |
| | | | Section 10.9. Overloaded Types and Members |
| | | | Chapter 11. Error Handling in Visual Basic |
| | | | Section 11.1. Error Detection and Error Handling |
| | | | Section 11.2. Runtime Error Handling |
| | | | Section 11.3. Dealing with Logic Errors |
| | | | Section 11.4. Error Constants |
| | | Part II: Reference |
| | | | Chapter 12. The Language Reference |
| | | | #Const Directive |
| | | | #If...Then...#Else Directive |
| | | | #Region...#End Region Directive |
| | | | Abs Function |
| | | | Acos Function |
| | | | AddHandler Statement |
| | | | AddressOf Operator |
| | | | AppActivate Procedure |
| | | | Application Class |
| | | | Application.CompanyName Property |
| | | | Application.DoEvents Method |
| | | | Application.ExecutablePath Property |
| | | | Application.ProductName Property |
| | | | Application.ProductVersion Property |
| | | | Application.Run Method |
| | | | Array Class |
| | | | Array.BinarySearch Method |
| | | | Array.Copy Method |
| | | | Array.IndexOf Method |
| | | | Array.LastIndexOf Method |
| | | | Array.Reverse Method |
| | | | Array.Sort Method |
| | | | Asc, AscW Functions |
| | | | AssemblyVersion Attribute |
| | | | Asin Function |
| | | | Atan Function |
| | | | Atan2 Function |
| | | | AttributeUsage Attribute |
| | | | Beep Procedure |
| | | | Call Statement |
| | | | CallByName Function |
| | | | CBool Function |
| | | | CByte Function |
| | | | CChar Function |
| | | | CDate Function |
| | | | CDbl Function |
| | | | CDec Function |
| | | | Ceiling Function |
| | | | ChDir Procedure |
| | | | ChDrive Procedure |
| | | | Choose Function |
| | | | Chr, ChrW Functions |
| | | | CInt Function |
| | | | Class...End Class Statement |
| | | | Clipboard Class |
| | | | CLng Function |
| | | | CLSCompliant Attribute |
| | | | CObj Function |
| | | | Collection Class |
| | | | Collection.Add Method |
| | | | Collection.Count Property |
| | | | Collection.Item Property |
| | | | Collection.Remove Method |
| | | | ColorDialog Class |
| | | | COMClass Attribute |
| | | | Command Function |
| | | | Const Statement |
| | | | Continue Statement |
| | | | Cos Function |
| | | | Cosh Function |
| | | | CreateObject Function |
| | | | CSByte Function |
| | | | CShort Function |
| | | | CSng Function |
| | | | CStr Function |
| | | | CType Function |
| | | | CUInt Function |
| | | | CULng Function |
| | | | CUShort Function |
| | | | CurDir Function |
| | | | Custom Event Statement |
| | | | DateAdd Function |
| | | | DateDiff Function |
| | | | DatePart Function |
| | | | DateSerial Function |
| | | | DateString Property |
| | | | DateValue Function |
| | | | Day Function |
| | | | DDB Function |
| | | | Debug Class |
| | | | Debug.Assert Method |
| | | | Debug.Listeners Property |
| | | | Debug.Write Method |
| | | | Debug.WriteIf Method |
| | | | Debug.WriteLine Method |
| | | | Debug.WriteLineIf Method |
| | | | Declare Statement |
| | | | DefaultMember Attribute |
| | | | Delegate Statement |
| | | | DeleteSetting Procedure |
| | | | Dim Statement |
| | | | Dir Function |
| | | | DirectCast Function |
| | | | Directory Class |
| | | | Directory.CreateDirectory Method |
| | | | Directory.Delete Method |
| | | | Directory.Exists Method |
| | | | Directory.GetCreationTime Method |
| | | | Directory.GetDirectories Method |
| | | | Directory.GetDirectoryRoot Method |
| | | | Directory.GetFiles Method |
| | | | Directory.GetFileSystemEntries Method |
| | | | Directory.GetLogicalDrives Method |
| | | | Directory.GetParent Method |
| | | | Directory.Move Method |
| | | | Do...Loop Statement |
| | | | E Field |
| | | | End Statement |
| | | | Enum Statement |
| | | | Environ Function |
| | | | EOF Function |
| | | | Erase Statement |
| | | | Erl Property |
| | | | Err Object |
| | | | Err.Clear Method |
| | | | Err.Description Property |
| | | | Err.GetException Method |
| | | | Err.HelpContext Property |
| | | | Err.HelpFile Property |
| | | | Err.LastDLLError Property |
| | | | Err.Number Property |
| | | | Err.Raise Method |
| | | | Err.Source Property |
| | | | Error Statement |
| | | | ErrorToString Function |
| | | | Event Statement |
| | | | Exception Class |
| | | | Exit Statement |
| | | | Exp Function |
| | | | File Class |
| | | | File.Exists Method |
| | | | FileAttr Function |
| | | | FileClose Procedure |
| | | | FileCopy Procedure |
| | | | FileDateTime Function |
| | | | FileGet, FileGetObject Procedures |
| | | | FileLen Function |
| | | | FileOpen Procedure |
| | | | FilePut, FilePutObject Procedures |
| | | | FileWidth Procedure |
| | | | Filter Function |
| | | | Fix Function |
| | | | Flags Attribute |
| | | | Floor Function |
| | | | FontDialog Class |
| | | | For...Next Statement |
| | | | For Each...Next Statement |
| | | | Format Function |
| | | | FormatCurrency, FormatNumber, FormatPercent Functions |
| | | | FormatDateTime Function |
| | | | FreeFile Function |
| | | | Friend Keyword |
| | | | Function Statement |
| | | | FV Function |
| | | | GetAllSettings Function |
| | | | GetAttr Function |
| | | | GetChar Function |
| | | | GetObject Function |
| | | | GetSetting Function |
| | | | GetType Operator |
| | | | Global Keyword |
| | | | GoTo Statement |
| | | | Guid Attribute |
| | | | Handles Keyword |
| | | | Hashtable Class |
| | | | Hashtable.Add Method |
| | | | Hashtable.ContainsKey Method |
| | | | Hashtable.ContainsValue Method |
| | | | Hashtable.CopyTo Method |
| | | | Hashtable.Item Property |
| | | | Hashtable.Keys Property |
| | | | Hashtable.Remove Method |
| | | | Hashtable.Values Property |
| | | | Hex Function |
| | | | Hour Function |
| | | | IEEERemainder Function |
| | | | If...Then...Else Statement |
| | | | IIf Function |
| | | | Implements Keyword |
| | | | Implements Statement |
| | | | Imports Statement |
| | | | Inherits Statement |
| | | | Input Procedure |
| | | | InputBox Function |
| | | | InputString Function |
| | | | InStr Function |
| | | | InStrRev Function |
| | | | Int Function |
| | | | Interface...End Interface Statement |
| | | | IPmt Function |
| | | | IRR Function |
| | | | Is Operator |
| | | | IsArray Function |
| | | | IsDate Function |
| | | | IsDBNull Function |
| | | | IsError Function |
| | | | IsNot Operator |
| | | | IsNothing Function |
| | | | IsNumeric Function |
| | | | IsReference Function |
| | | | Join Function |
| | | | Kill Procedure |
| | | | LBound Function |
| | | | LCase Function |
| | | | Left Function |
| | | | Len Function |
| | | | Like Operator |
| | | | LineInput Function |
| | | | Loc Function |
| | | | Lock Procedure |
| | | | LOF Function |
| | | | Log Function |
| | | | Log10 Function |
| | | | LSet Function |
| | | | LTrim Function |
| | | | MarshalAs Attribute |
| | | | Max Function |
| | | | Me Keyword |
| | | | Mid Function |
| | | | Mid Statement |
| | | | Min Function |
| | | | Minute Function |
| | | | MIRR Function |
| | | | MkDir Procedure |
| | | | Mod Operator |
| | | | Module...End Module Statement |
| | | | Month Function |
| | | | MonthName Function |
| | | | MsgBox Function |
| | | | MTAThread Attribute |
| | | | MyBase Keyword |
| | | | MyClass Keyword |
| | | | Namespace Statement |
| | | | New Keyword |
| | | | Nothing Keyword |
| | | | Now Property |
| | | | NPer Function |
| | | | NPV Function |
| | | | Obsolete Attribute |
| | | | Oct Function |
| | | | Of Keyword |
| | | | On Error Statement |
| | | | OpenFileDialog Class |
| | | | Operator Statement |
| | | | Option Compare Statement |
| | | | Option Explicit Statement |
| | | | Option Strict Statement |
| | | | Out Attribute |
| | | | ParamArray Attribute |
| | | | Partial Keyword |
| | | | Partition Function |
| | | | PI Field |
| | | | Pmt Function |
| | | | Pow Function |
| | | | PPmt Function |
| | | | Print, PrintLine Procedures |
| | | | Private Keyword |
| | | | Property Statement |
| | | | Protected Keyword |
| | | | Public Keyword |
| | | | PV Function |
| | | | QBColor Function |
| | | | Queue Class |
| | | | Queue.Contains Method |
| | | | Queue.CopyTo Method |
| | | | Queue.Dequeue Method |
| | | | Queue.Enqueue Method |
| | | | Queue.Peek Method |
| | | | Queue.ToArray Method |
| | | | RaiseEvent Statement |
| | | | Randomize Procedure |
| | | | Rate Function |
| | | | ReDim Statement |
| | | | Rem Statement |
| | | | RemoveHandler Statement |
| | | | Rename Procedure |
| | | | Replace Function |
| | | | Reset Procedure |
| | | | Resume Statement |
| | | | Return Statement |
| | | | RGB Function |
| | | | Right Function |
| | | | RmDir Procedure |
| | | | Rnd Function |
| | | | Round Function |
| | | | RSet Function |
| | | | RTrim Function |
| | | | SaveFileDialog Class |
| | | | SaveSetting Procedure |
| | | | ScriptEngine Property |
| | | | ScriptEngineBuildVersion Property |
| | | | ScriptEngineMajorVersion Property |
| | | | ScriptEngineMinorVersion Property |
| | | | Second Function |
| | | | Seek Function |
| | | | Seek Procedure |
| | | | Select Case Statement |
| | | | Send, SendWait Methods |
| | | | SetAttr Procedure |
| | | | Shadows Keyword |
| | | | Shared Keyword |
| | | | Shell Function |
| | | | Sign Function |
| | | | Sin Function |
| | | | Sinh Function |
| | | | SLN Function |
| | | | Space Function |
| | | | SPC Function |
| | | | Split Function |
| | | | Sqrt Function |
| | | | Stack Class |
| | | | Stack.Contains Method |
| | | | Stack.CopyTo Method |
| | | | Stack.Peek Method |
| | | | Stack.Pop Method |
| | | | Stack.Push Method |
| | | | Stack.ToArray Method |
| | | | STAThread Attribute |
| | | | Static Statement |
| | | | Stop Statement |
| | | | Str Function |
| | | | StrComp Function |
| | | | StrConv Function |
| | | | StrDup Function |
| | | | StrReverse Function |
| | | | Structure...End Structure Statement |
| | | | Sub Statement |
| | | | Switch Function |
| | | | SYD Function |
| | | | SyncLock Statement |
| | | | SystemTypeName Function |
| | | | TAB Function |
| | | | Tan Function |
| | | | Tanh Function |
| | | | ThreadStatic Attribute |
| | | | Throw Statement |
| | | | TimeOfDay Property |
| | | | Timer Property |
| | | | TimeSerial Function |
| | | | TimeString Property |
| | | | TimeValue Function |
| | | | Today Property |
| | | | Trim Function |
| | | | Try...Catch...Finally Statement |
| | | | TryCast Function |
| | | | TypeName Function |
| | | | TypeOf Operator |
| | | | UBound Function |
| | | | UCase Function |
| | | | Unlock Procedure |
| | | | Using...End Using Statement |
| | | | Val Function |
| | | | VarType Function |
| | | | VBFixedArray Attribute |
| | | | VBFixedString Attribute |
| | | | VbTypeName Function |
| | | | WebMethod Attribute |
| | | | WebService Attribute |
| | | | Weekday Function |
| | | | WeekdayName Function |
| | | | While...End While Statement |
| | | | With...End With Statement |
| | | | WithEvents Keyword |
| | | | Write, WriteLine Procedures |
| | | | Year Function |
| | | | Chapter 13. The 'My' Reference |
| | | | AllUsersApplicationData Property |
| | | | AltKeyDown Property |
| | | | Application Object |
| | | | ApplicationContext Property |
| | | | AssemblyName Property |
| | | | Audio Object |
| | | | AvailablePhysicalMemory Property |
| | | | AvailableVirtualMemory Property |
| | | | ButtonsSwapped Property |
| | | | CapsLock Property |
| | | | ChangeCulture Method |
| | | | ChangeUICulture Method |
| | | | ClassesRoot Property |
| | | | Clear Method |
| | | | Clipboard Object |
| | | | Clock Object |
| | | | Close Method |
| | | | CombinePath Method |
| | | | CommandLineArgs Property |
| | | | CommentTokens Property |
| | | | CompanyName Property |
| | | | Computer Object |
| | | | ContainsAudio Method |
| | | | ContainsData Method |
| | | | ContainsFileDropList Method |
| | | | ContainsImage Method |
| | | | ContainsText Method |
| | | | CopyDirectory Method |
| | | | CopyFile Method |
| | | | Copyright Property |
| | | | CreateDirectory Method |
| | | | CtrlKeyDown Property |
| | | | Culture Property |
| | | | CurrentConfig Property |
| | | | CurrentDirectory Property |
| | | | CurrentPrincipal Property |
| | | | CurrentUser Property |
| | | | CurrentUserApplicationData Property |
| | | | DefaultFileLogWriter Property |
| | | | DeleteDirectory Method |
| | | | DeleteFile Method |
| | | | Delimiters Property |
| | | | Deployment Property |
| | | | Description Property |
| | | | Desktop Property |
| | | | DirectoryExists Method |
| | | | DirectoryPath Property |
| | | | DoEvents Method |
| | | | DownloadFile Method |
| | | | Drives Property |
| | | | DynData Property |
| | | | EndOfData Property |
| | | | ErrorLine Property |
| | | | ErrorLineNumber Property |
| | | | FieldWidths Property |
| | | | FileExists Method |
| | | | FileSystem Object |
| | | | FindInFiles Method |
| | | | Forms Object |
| | | | GetAudioStream Method |
| | | | GetData Method |
| | | | GetDataObject Method |
| | | | GetDirectories Method |
| | | | GetDirectoryInfo Method |
| | | | GetDriveInfo Method |
| | | | GetEnvironmentVariable Method |
| | | | GetFileDropList Method |
| | | | GetFileInfo Method |
| | | | GetFiles Method |
| | | | GetImage Method |
| | | | GetName Method |
| | | | GetParentPath Method |
| | | | GetTempFileName Method |
| | | | GetText Method |
| | | | GetValue Method |
| | | | GmtTime Property |
| | | | HasFieldsEnclosedInQuotes Property |
| | | | Info Object (My.Application) |
| | | | Info Object (My.Computer) |
| | | | InitializeWithWindowsUser Method |
| | | | InstalledUICulture Property |
| | | | IsAuthenticated Property |
| | | | IsAvailable Property |
| | | | IsInRole Method |
| | | | IsNetworkDeployed Property |
| | | | Keyboard Object |
| | | | LineNumber Property |
| | | | LoadedAssemblies Property |
| | | | LocalMachine Property |
| | | | LocalTime Property |
| | | | Log Object (My) |
| | | | Log Object (My.Application) |
| | | | MinimumSplashScreenDisplayTime Property |
| | | | Mouse Object |
| | | | MoveDirectory Method |
| | | | MoveFile Method |
| | | | My Namespace |
| | | | MyDocuments Property |
| | | | MyMusic Property |
| | | | MyPictures Property |
| | | | Name Property (My.Computer) |
| | | | Name Property (My.User) |
| | | | Network Object |
| | | | NetworkAvailabilityChanged Event (My.Application) |
| | | | NetworkAvailabilityChanged Event (My.Computer.Network) |
| | | | NumLock Property |
| | | | OpenForms Property |
| | | | OpenSerialPort Method |
| | | | OpenTextFieldParser Method |
| | | | OpenTextFileReader Method |
| | | | OpenTextFileWriter Method |
| | | | OSFullName Property |
| | | | OSPlatform Property |
| | | | OSVersion Property |
| | | | PeekChars Method |
| | | | PerformanceData Property |
| | | | Ping Method |
| | | | Play Method |
| | | | PlaySystemSound Method |
| | | | Ports Object |
| | | | ProductName Property |
| | | | ProgramFiles Property |
| | | | Programs Property |
| | | | ReadAllBytes Method |
| | | | ReadAllText Method |
| | | | ReadFields Method |
| | | | ReadLine Method |
| | | | ReadToEnd Method |
| | | | Registry Object |
| | | | RenameDirectory Method |
| | | | RenameFile Method |
| | | | Request Object |
| | | | Resources Object |
| | | | Response Object |
| | | | Run Method |
| | | | SaveMySettingsOnExit Property |
| | | | Screen Property |
| | | | ScrollLock Property |
| | | | SendKeys Method |
| | | | SerialPortNames Property |
| | | | SetAudio Method |
| | | | SetData Method |
| | | | SetDataObject Method |
| | | | SetDelimiters Method |
| | | | SetFieldWidths Method |
| | | | SetFileDropList Method |
| | | | SetImage Method |
| | | | SetText Method |
| | | | Settings Object |
| | | | SetValue Method |
| | | | ShiftKeyDown Property |
| | | | Shutdown Event |
| | | | SpecialDirectories Object |
| | | | SplashScreen Property |
| | | | StackTrace Property |
| | | | Startup Event |
| | | | StartupNextInstance Event |
| | | | Stop Method |
| | | | Temp Property |
| | | | TextFieldParser Object |
| | | | TextFieldType Property |
| | | | TickCount Property |
| | | | Title Property |
| | | | TotalPhysicalMemory Property |
| | | | TotalVirtualMemory Property |
| | | | TraceSource Property |
| | | | Trademark Property |
| | | | TrimWhiteSpace Property |
| | | | UICulture Property |
| | | | UnhandledException Event |
| | | | UploadFile Method |
| | | | User Object |
| | | | Users Property |
| | | | Version Property |
| | | | WebServices Object |
| | | | WheelExists Property |
| | | | WheelScrollLines Property |
| | | | WorkingSet Property |
| | | | WriteAllBytes Method |
| | | | WriteAllText Method |
| | | | WriteEntry Method |
| | | | WriteException Method |
| | | Part III: Appendixes |
| | | | Appendix A. Language Elements by Category |
| | | | Section A.1. Array Handling |
| | | | Section A.2. Clipboard |
| | | | Section A.3. Collection Objects |
| | | | Section A.4. Common Dialogs |
| | | | Section A.5. Conditional Compilation |
| | | | Section A.6. Conversion |
| | | | Section A.7. Date and Time |
| | | | Section A.8. Debugging |
| | | | Section A.9. Declaration |
| | | | Section A.10. Error Handling |
| | | | Section A.11. File System |
| | | | Section A.12. Financial |
| | | | Section A.13. Information |
| | | | Section A.14. Input/Output |
| | | | Section A.15. Integrated Development Environment |
| | | | Section A.16. Interaction |
| | | | Section A.17. Mathematics |
| | | | Section A.18. Program Structure and Flow |
| | | | Section A.19. Programming |
| | | | Section A.20. Registry |
| | | | Section A.21. String Manipulation |
| | | | Appendix B. Namespace Hierarchy |
| | | | Section B.1. 'My' Namespace Hierarchy |
| | | | Section B.2. System Namespace Hierarchy |
| | | | Appendix C. Constants and Enumerations |
| | | | Section C.1. Visual Basic Intrinsic Constants |
| | | | Section C.2. ControlChars Class |
| | | | Section C.3. Visual Basic Enumerations |
| | | | Appendix D. What's New and Different in Visual Basic .NET 2002 |
| | | | Section D.1. Language Changes in VB.NET 2002 |
| | | | Section D.2. Changes to Programming Elements |
| | | | Section D.3. Obsolete Programming Elements |
| | | | Section D.4. Structured Exception Handling |
| | | | Section D.5. Changes in Object Orientation |
| | | | Appendix E. What's New and Different in Visual Basic .NET 2003 |
| | | | Section E.1. Language Changes in VB.NET 2003 |
| | | | Appendix F. What's New and Different in Visual Basic 2005 |
| | | | Section F.1. Enhancements of Existing Functionality |
| | | | Section F.2. The 'My' Namespace |
| | | | Section F.3. Other New Features |
| | | | Appendix G. VB 6 Language Elements No Longer Supported |
| | | | Appendix H. The Visual Basic Command-Line Compiler |
| | | | Section H.1. Compiler Basics |
| | | | Section H.2. Command-Line Switches |
| | | | Section H.3. Using a Response File |
| | | | Section H.4. Conditional Compilation Constants |
| | | About the Authors |
| | | Colophon |
| | | Index |