ebook img

Visual Basic .NET Black Book by Steven Holzner PDF

2197 Pages·2012·11.53 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Visual Basic .NET Black Book by Steven Holzner

Visual Basic .NET Black Book by Steven Holzner ISBN:1932111042 Paraglyph Press Š 2002 (1184 pages) Covers Visual Basic.NET tips, examples, and how-tos on everything from programming to managing the development of Visual Basic applications, and provides in-depth material on the new object-oriented features of Visual Basic .NET. BackCover Visual Basic .NET Black Book Introduction What's in This Book Conventions What You'll Need Resources Chapter 1: Essential Visual Basic Putting Visual Basic to Work What's New in VB .NET? Upgrading from Visual Basic 6.0 The .NET Framework and the Common Language Runtime Building VB .NET Applications The Visual Basic Integrated Development Environment Coding to Get the Most from Visual Basic Chapter 2: The Visual Basic Language: Operators, Conditionals, and Loops The Visual Basic Keywords Visual Basic Statements All About Statement Syntax The Option and Imports Statements Immediate Solutions: Declaring Constants Creating Enumerations Declaring Variables What Data Types Are Available? Converting between Data Types Checking Data Types Declaring Arrays and Dynamic Arrays Handling Strings Converting Strings to Numbers and Back Again Converting between Characters and Character Codes Using Visual Basic Operators Understanding Visual Basic Operator Precedence Commenting Your Code Making Decisions with IfĄElse Statements Using Select Case Making Selections with Switch and Choose Looping to Execute Statements Repetitively Using the Do Loop Using the For Loop Using the For EachĄNext Loop Using the While Loop The With Statement Handling Higher Math Handling Dates and Times Handling Financial Data Ending a Program at Any Time Chapter 3: The Visual Basic Language: Procedures, Scope, and Exception Handling Sub Procedures and Functions Understanding Scope Handling Exceptions Immediate Solutions: Creating Sub Procedures Creating Functions Commenting Your Procedures Passing a Variable Number of Arguments Specifying Optional Procedure Arguments Preserving a Variable's Values between Procedure Calls Creating Procedure Delegates Creating Properties Understanding Scope Using Unstructured Exception Handling Using Resume Next and Resume Line Using On Error GoTo 0 Getting an Exception's Number and Description Raising an Exception Intentionally Using Structured Exception Handling Exception Filtering in the Catch Block Using Multiple Catch Statements Using Finally Throwing an Exception Throwing a Custom Exception Chapter 4: Windows Forms All About Windows Forms All About Windows MDI Forms Creating Windows Applications Adding Controls to Forms Handling Events A Windows Form in Code Immediate Solutions: Setting Title Bar Text Adding/Removing Min/Max Buttons and Setting a Form's Border Setting Control Tab Order Setting Forms' Initial Positions Moving and Sizing Forms and Controls in Code Showing and Hiding Controls and Forms Using the MsgBox Function Using the MessageBox.Show Method Using the InputBox Function Working with Multiple Forms Using Properties to Communicate between Forms Setting the Startup Form Creating Multiple Document Interface (MDI) Applications Creating Dialog Boxes Creating Owned Forms Passing Forms to Procedures Minimizing/Maximizing and Enabling/Disabling Forms Anchoring and Docking Controls Adding and Removing Controls at Run Time Creating Always-on-Top Forms Using Visual Inheritance between Forms Handling Mouse Events Handling Keyboard Events Sending Keystrokes to Other Programs Beeping Chapter 5: Windows Forms: Text Boxes, Rich Text Boxes, Labels, and Link Labels The Control Class Text Boxes Rich Text Boxes Labels Link Labels Immediate Solutions: Setting the Mouse Pointer in Controls Text Boxes Creating Multiline, Word-wrap Text Boxes Accessing Text in a Text Box Adding Scroll Bars to Text Boxes Aligning Text in Text Boxes Making a Text Box Read-only Selecting and Replacing Text in a Text Box Copying or Getting Selected Text to or from the Clipboard Creating a Password Control Controlling Input in a Text Box Creating a Text Box in Code Rich Text Boxes Accessing Text in a Rich Text Box Creating Bold, Italic, Underlined, and Strikeout Text Indenting Text in Rich Text Boxes Adding Bullets to Rich Text Boxes Setting Text Color in RTF Boxes Saving and Loading RTF Files from and to Rich Text Boxes Aligning Text in a Rich Text Box Creating Rich Text Boxes in Code Labels Using Labels Instead of Text Boxes Formatting Text in Labels Aligning Text in Labels Handling Label Events Using Labels to Give Access Keys to Controls without Captions Link Labels Creating a LinkLabel Creating a LinkLabel in Code Linking to Another Form Linking to the Web Chapter 6: Windows Forms: Buttons, Checkboxes, Radio Buttons, Panels, and Group Boxes Buttons Checkboxes Radio Buttons Panels Group Boxes Immediate Solutions: All About Buttons Setting a Button's Caption Setting a Button's Foreground and Background Color Setting Button Fonts Handling Button Clicks Imitating Control Arrays Resetting the Focus after a Button Click Giving Buttons and Other Controls Access Characters Setting Button Tab Order Disabling Buttons Showing and Hiding Buttons Resizing and Moving Buttons from Code Adding a Picture to a Button Adding Buttons at Run Time Passing Buttons to Procedures Handling Button Releases Using the Checkbox Class Creating Checkboxes Getting a Checkbox's State Setting a Checkbox's State Creating Three-State Checkboxes Using the RadioButton Class Creating Radio Buttons Getting a Radio Button's State Setting a Radio Button's State Creating Toggle Buttons Using the Panel Class Creating Panels Adding Controls to Panels in Code Using the GroupBox Class Creating Group Boxes Adding Controls to Group Boxes in Code Chapter 7: Windows Forms: List Boxes, Checked List Boxes, Combo Boxes, and Picture Boxes List Boxes Checked List Boxes Combo Boxes Picture Boxes Immediate Solutions: Using the ListBox Class Adding Items to a List Box Referring to Items in a List Box by Index Responding to List Box Events Removing Items from a List Box Sorting a List Box Determining How Many Items Are in a List Box Determining Which List Box Items Are Selected Making List Boxes Scroll Horizontally (Multicolumn List Boxes) Creating Multiselect List Boxes Clearing a List Box Using the CheckedListBox Class Adding Items to Checked List Boxes Determining What Items Are Checked in Checked List Boxes Checking or Unchecking Items in Checked List Boxes from Code Handling Item Check Events in Checked List Boxes Using the ComboBox Class Creating Simple Combo Boxes, Drop-down Combo Boxes, and Drop-down List Combo Boxes Adding Items to a Combo Box Responding to Combo Box Selections Removing Items from a Combo Box Getting the Current Selection in a Combo Box Sorting a Combo Box Clearing a Combo Box Getting the Number of Items in a Combo Box Storing Objects in a List Box or Combo Box Using the PictureBox Class Setting or Getting the Image in a Picture Box Adjusting Picture Box Size to Contents Handling Picture Box Events (and Creating Image Maps) Chapter 8: Windows Forms: Scroll Bars, Splitters, Track Bars, Pickers, Notify Icons, Tool Tips, and Timers Scroll Bars Splitters Track Bars Pickers Notify Icons Tool Tips Timers Immediate Solutions: Using the HScrollBar and VScrollBar Classes Setting Scroll Bars' Minimum and Maximum Values Setting Up Scroll Bar Clicks (Large Changes) Setting Up Scroll Bar Arrow Clicks (Small Changes) Getting and Setting a Scroll Bar's Current Value Handling Scroll Bar Events Showing and Hiding Scroll Bars Coordinating Scroll Bar Pairs Scrolling Images Adding Scroll Bars to Text Boxes Using the Splitter Class Creating Splitter Controls Using the TrackBar Class Handling Track Bar Events Setting Track Bar Ticks Using the DateTimePicker Class Handling Date-Time Picker Events Setting Date-Time Picker Custom Formats Using the MonthCalendar Class Handling Month Calendar Control Events Using the NotifyIcon Class Creating Notify Icons and Using Icon Designers Handling Notify Icon Events Using the ToolTip Class Creating Tool Tips Using the Timer Class Setting a Timer's Interval Turning Timers On and Off Handling Timer EventsĄŞand Creating an Alarm Clock Chapter 9: Windows Forms: Menus, Built-in Dialog Boxes, and Printing Menus Menu Items Context Menus The Built-in Dialog Boxes Open File Dialogs Save File Dialogs Font Dialogs Color Dialogs Printing Documents Print Dialogs Print Preview Dialogs Custom Print Previews Page Setup Dialogs Immediate Solutions: Using the MainMenu Class Using the MenuItem Class Creating Menus Creating Submenus Adding Checkmarks to Menu Items Creating Menu Access Keys Creating Menu Shortcuts Changing a Menu Item's Caption at Run Time Creating Menu Separators Using the Popup Event Showing and Hiding Menu Items Disabling Menu Items Drawing Menu Items Yourself Creating Menus in Code Merging MDI Menus Creating MDI Window Menus Using the ContextMenu Class Creating Context Menus Using the OpenFileDialog Class Creating Open File Dialogs Using the SaveFileDialog Class Creating Save File Dialogs Using the FontDialog Class Creating Font Dialogs Using the ColorDialog Class Creating Color Dialogs Printing with the Printing Example Using the PrintDocument and PrintSetting Classes Using the PrintDialog Class Printing Using the PrintPreviewDialog Class Creating Print Preview Dialogs Using the PrintPreviewControl Class Creating Custom Print Previews Using the PageSetupDialog Class Creating Page Setup Dialogs Chapter 10: Windows Forms: Image Lists, Tree and List Views, Toolbars, Status and Progress Bars, and Tab Controls Image Lists Tree Views List Views Toolbars Status Bars Progress Bars Tab Controls Immediate Solutions: Using the ImageList Class Creating Image Lists Using Image Lists with ListView, TreeView, ToolBar, TabControl, Button, CheckBox, RadioButton, and Label Controls Using Image Lists with Picture Boxes and Other Controls with Image or BackgroundImage Properties Using Image Lists with Other Controls Adding Images to Image Lists in Code Using the TreeView Class Using the TreeNode Class Creating Tree Views Handling Tree View Events Using Checkboxes in Tree Views Creating Tree Views in Code Using the ListView Class Using the ListViewItem Class Creating List Views Creating List Views in Code Selecting List View Views Handling List View Item Selections Handling Column Clicks in List Views Using Checkboxes in List Views Using the ToolBar Class Using the ToolBarButton Class Creating Toolbars Handling Toolbar Button Clicks Creating Toolbar Drop-down Buttons Connecting Toolbar Buttons to Menu Items Creating Toolbar Image Buttons Adding Combo Boxes and Other Controls to Toolbars Adding Buttons to a Toolbar at Run Time Using the StatusBar Class Using the StatusBarPanel Class Creating Simple Status Bars Adding Panels to a Status Bar Displaying Text in Status Bar Panels Displaying Icons in Status Bar Panels Handling Status Bar Panel Clicks Using the ProgressBar Control Creating Progress Bars Using the TabControl Class Using the TabPage Class Creating Tab Controls Displaying an Icon in a Tab Creating Multiple Rows of Tabs Arranging Tabs Sideways or on the Bottom Displaying Tabs as Buttons Hot-Tracking Tabs Adding New Tabs at Run Time Adding Controls to Tab Pages at Run Time Chapter 11: Object-Oriented Programming Classes and Objects Fields, Properties, Methods, and Events Class vs. Object Members Abstraction, Encapsulation, Inheritance, and Polymorphism Overloading, Overriding, and Shadowing Constructors and Destructors An OOP Example Structures and Modules Immediate Solutions: Creating Classes Creating Objects Creating Structures Creating Modules Creating Constructors Using Is to Compare Objects Creating Data Members Creating Class (Shared) Data Members Creating Methods Creating Class (Shared) Methods Creating Properties Creating Class (Shared) Properties Creating Events Creating Class (Shared) Events Overloading Methods and Properties Getting Rid of Objects When You're Done with Them Triggering Garbage Collection Creating Class Libraries Creating Namespaces Using the Finalize Method (Creating Destructors) Chapter 12: Object-Oriented Inheritance Access Modifiers Inheritance Modifiers Overloading, Overriding, and Shadowing Creating Interfaces Polymorphism Early and Late Binding Immediate Solutions: Inheriting from a Base Class Using Public Inheritance Using Protected Inheritance Using Private Inheritance Using Friend Access Overriding Base Class Members Inheriting Constructors Overloading Base Class Members Creating Interfaces Using Multiple Interfaces Using the MustInherit Keyword (Creating Abstract Classes) Using MustOverride, Overridable, and NotOverridable Creating Shadowing Using the MyBase Keyword Using the MyClass Keyword Inheritance-based Polymorphism Interface-based Polymorphism Early and Late Binding Chapter 13: Graphics and File Handling Graphics Handling File Handling Immediate Solutions: Using the Graphics Class Using the Pen Class Specifying Drawing Colors Drawing Figures with Pens Repainting Windows Using Brush Classes Filling Figures with Brushes Using the Pens and Brushes Classes Handling Images Using the FileStream Class Using the FileMode Enumeration Using the FileAccess Enumeration Using the FileShare Enumeration Opening or Creating a File with the FileStream Class Using the StreamWriter Class Writing Text with the StreamWriter Class Using the StreamReader Class Reading Text with the StreamReader Class Using the BinaryWriter Class Writing Binary Data with the BinaryWriter Class Using the BinaryReader Class Reading Binary Data with the BinaryReader Class Using the File Class Using the Directory class Putting the File and Directory Classes to Work Chapter 14: Web Forms Working with Web Forms Working with Web Form Controls Saving a Web Application's State Web Forms and HTML Creating a Web Application Running a Web Application Using the HTML Editor to Customize Web Pages Creating a Multiform Web Project Handling Client Events Immediate Solutions: Using the System.Web.UI.Page Class Initializing a Web Form at Run Time Setting Control Layout Forcing Event Handling Setting Colors in Web Forms and HTML Pages Setting Title Bar Text Setting Hyperlink Colors Setting Page Margins Setting Text Color Creating an Error Page Setting Background Images Setting Background Color Setting Background Properties Setting Content Type Setting Search Engine Keywords Adding a New Web Form Adding a New HTML Page Navigating to Another Form Redirecting to Another Form Writing HTML to a Web Form at Run Time Detecting Browser Type and Capabilities Embedding Visual Basic Code in Web Pages Saving Program Data across Server Round Trips Chapter 15: Web Forms: Buttons, Text Boxes, Labels, Literals, and Place Holders The Control Class The WebControl Class Creating Buttons Creating Text Boxes Creating Labels Creating Literals Creating Place Holders Immediate Solutions: Enabling and Disabling Controls Making Controls Visible and Invisible Giving Controls Tool Tips Setting a Control's Style Giving a Control an Access Key Moving Controls Setting Control Fonts Setting Control Border Style Using the Button Class Creating Buttons Creating Command Buttons Using the TextBox Class Creating Text Boxes Creating Multiline Text Boxes Creating Password Controls Creating Read-only Text Boxes Setting Text Box Columns and Rows Using the Label Class Creating Labels Setting Label Text and Style Using the Literal Class Creating Literals Using the PlaceHolder Class Adding Controls at Run Time Chapter 16: Web Forms: Checkboxes, Radio Buttons, Tables, and Panels Checkboxes Checkbox Lists Radio Buttons Radio Button Lists Tables Panels Immediate Solutions: Using the CheckBox Class Creating Checkboxes Using the ListControl Class Using the ListItem Class Using the CheckBoxList Class Creating Checkbox Lists Using the RadioButton Class Creating Radio Buttons Using the RadioButtonList Class Creating Radio Button Lists Using the Table Class Using the TableRow Class Using the TableCell Class Creating a Table Using the Panel Class Creating Panels Chapter 17: Images, Image Buttons, List Boxes, Drop-Down Lists, Hyperlinks, and Link Buttons Image Controls Image Buttons List Boxes

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.