Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Beginning Visual Basic 2005 Express Edition - From Novice To Professional (2006)

.pdf
Скачиваний:
387
Добавлен:
17.08.2013
Размер:
21.25 Mб
Скачать

510I N D E X

FormatException property, Windows GUI, 160

Formatting dialog box, 446 FormBorderStyle property, 236 FormClosed event, 238 FormClosing event, 238 forms, 37, 237–241

Forward button, 32 FullName property, 116 FullName value, 119 Function keyword, 103

G

GameGraphic subclasses, 135 garbage collector, .NET, 102 GenerateMember property, 191 generics

creating own, 357–358 dictionaries

overview, 346–347

working with Dictionary, 347–351, 353–354, 356

Lists and SortedLists

Find( ) methods, 336–343 finding items in list, 333–336 overview, 332–333

sorting lists, 343, 345–346 overview, 331

Queues, 357

Stacks, 356–357

GetBookDetailsFromWebPage( ) method, 467, 470–471

GetChanges( ) method, 436

GetData( ) method, 422, 432

GetDirectories( ) method, 367

GetFiles( ) method, 367

GetHashCode( ) method, System.Object, 354 GetResponseStream( ) method, 380 GetType( ) method, 154 GetWeatherByPlaceName( ) method, 475

GetWeatherByZipCode( ) method, 475 GetWebPage( ) method, 459, 468–469 Go button, 30

GoBack( ) method, 32, 455 goButton_Click code, 31

GoForward( ) method, WebBrowser control, 455

GoHome( ) method, WebBrowser control, 455

GoSearch( ) method, WebBrowser control, 455

graphical query builder, 438 graphical user interface, 1

H

Handles keyword, 318 Handles statement, 190 hash, 347

Hello, World example, 5, 8

HelloFunc event, HelloFunctionDelegate delegate, 321

HireEmployee( ) method, HRActionDelegate delegate, 323

HRActionDelegate delegate, 322

HTML (HyperText Markup Language), 383

HyperText Markup Language (HTML), 383

I

IDE (integrated development environment) overview, 4–6, 8–13, 15–16

working with editors, 16–26 writing own web browser, 27–32

if statements, 60, 81–84 Image properties, 299 ImageAlign property, 300 ImageList control, 287

ImageList property, Properties window, 288 images, adding to menus, 299–305

Images Collection Editor dialog, 288 ImageScaling property, 301 ImageScalingSize properties, 301

ImageTransparentColor property, 300, 303 immutable strings, 201

Implements keyword, 146 index variable, 90–91 IndexOf( ) method, 74–77 inheritance, 50–51, 128

abstract methods and classes, 134–136, 138 interfaces, 143–147

overview, 127–131 partial classes, 147–149 virtual methods, 131–134

InitializeComponent( ) method, 175 InnerException property, Windows GUI, 160 InnerText property, 392

inputBox control, Text Box, 199

Insert( ) methods, XmlDocument object, 407 Insert Snippet, 23

instance members, 125 instances, 94

integers operators, 67–71 overview, 66 types, 66

integral types table, 66 IntegralHeight property, 265

integrated development environment. See IDE (integrated development environment)

IntelliSense, 19

automatically fixing namespace problems, 181–182

overview, 181

using code snippets, 182 IntelliSense option, 182 IntelliSense pop-up, 110 interfaces, 143–145, 147 Internet and C# Express

using web services, 474, 478 WebBrowser control

I N D E X 511

handling other types of data with

WebClient, 467–471

 

working with, 455–456

 

Internet and Visual Basic

 

overview, 449

 

using web services, 472–480

 

WebBrowser control

 

accessing web through code, 456–465

 

handling other types of data with

 

WebClient, 465–471

 

overview, 449–454

 

working with, 454–456

 

Internet Explorer context menu, 454

 

Interval property, 482

Find

IsBusy property, 492

it

IsMDIContainer property, 306

faster

IsMdiContainer property, Properties

window, 243

at

Key parameter, 289

com.apress.http://superindex

item elements, 403

 

item node, 399

 

<item> tags, 391

 

Items property, 262, 278

 

Items property, ListBox, 274

 

Items.Count property, 266

 

K

 

keyboard cursor keys, 198

 

KeyNotFoundException exception, 353

 

keys, 346

 

keywords, 122

 

L

 

Label control, 8

 

LastIndexOf( ) method, 74–76

 

Layout event, 238

 

LayoutMdi( ) method, 245–246

 

Leave event, Text Box, 198

 

Length property, 78

 

Lines property, 198, 204

 

512I N D E X

LinkedList collection, System.Collections.Generics namespace, 331

List collection, System.Collections.Generics namespace, 331

list controls, 261

ListBox control, 261–275, 277–278, 457, 486 ListBox.Items collection, 330

lists

CheckedListBox control, 278–279 ComboBox control, 279–281 ListBox control, 262–275, 277–278 overview, 261

TreeView control

changing visual appearance of tree, 285–291

overview, 281–285

responding to selections and finding nodes, 292

Lists and SortedLists

Find( ) methods, 336–343 finding items in list, 333–336 overview, 332–333

sorting lists, 343, 345–346 Load event, 238–239

LoadXml( ) method, XmlDocument object, 386 LocationChanged event, 238

Location.X property, 191 Location.Y property, 191 lock( ) keyword, 495 loginAttempts, 68 LoginID property, 432 LogInUser( ) method, 166 looping keywords, 60 loops, 26

For loops, 90–91 overview, 86 While loops, 86–90

LostFocus event, 188

M

Main( ) method, 38–46, 64–65, 99, 112, 130, 181–182, 334, 352, 375, 433

Mask property, 209

Mask property, MaskedTextBox, 210 MaskedTextBox control, 208–210 MaskInputRejected event handler, 211 MatchCollection object, 462

MaxDate property, MonthCalendar control, 222

MaximizeBox property, 236

MaximumSize property, 236

MDI (Multiple Document Interface),

242–247, 305–310

MdiChildren form, 309

MdiParent form, 309

MdiParent property, MDI, 244

members. See properties and members menu controls, 296

menus

adding images and shortcuts to, 299–305 building, 296–299

context menu control, 311–312 in MDI application, 305–310 overview, 295

MenuStrip control, 295, 301 message box, 84

message loop, 188 Message property, 160, 167 MessageBox class, 247 meta characters, 463 methods

abstract, 134–138 creating, 41–46 overview, 103–110 polymorphism, 110–113 virtual, 131–134

Microserfs, 93

Microsoft Developer Network (MSDN), 502

Microsoft Intermediate Language (MSIL), 2

Microsoft Internet Explorer keyboard shortcuts, 451

MinDate property, MonthCalendar control, 222

MinimizeBox property, 236 MinimumSize property, 236 Mod operator, 285 modules, 37

modulus, 68

MonthCalendar control, 221, 224 MouseCaptureChanged event, 238 MouseEnter event, 193

Move( ) method, 367

Move event, 238

MoveNext( ) method, 397

MoveToAttribute( ) method, XmlReader class, 401

MoveToContent( ) method, XmlReader class, 401, 403

Movie Collection starter kit, 498

MSDN (Microsoft Developer Network), 502 MSIL (Microsoft Intermediate Language), 2 Multiline property, Text Box, 198

Multiline property, text boxes, 202

Multiple Document Interface (MDI),

242–247, 305–310

MustInherit class, 136 MustInherit keyword, 135 MustOverride keyword, 54, 135 MustOverride method, 136 myArray string array, 330 myEmployee object, 495

N

Name property, 30, 190, 205, 224, 265, 365, 385, 482

names array, 79 Names objects, 111

namespaces, 21, 124, 181–182

I N D E X 513

Navigate( ) method, 455, 464

 

Navigate method, 30–31

 

.NET class library, 145

 

.NET compilers, 2

 

.NET Framework, 1, 157

 

.NET language, 2

 

network streams, 378–381

 

NetworkStream namespace, 378

 

New( ) method, 53

 

new Calculator( ) method, 108

 

New Horizontal Tab Group, 18

 

New Vertical Tab Group, 18

 

NewEmployee( ) methods, Employee class, 326

it Find

NewEmployeeRow( ) method, 438

newWindow variable, 233–234

No button, 118

faster

 

NodeCount property, 292

at

NodeMouseClick event, 292

com.apress.http://superindex

Nodes collections, 289

 

NotifyFilter property, 361–362

 

NotifyFilters.Attributes, NotifyFilter

 

enumeration, 362

 

NotifyFilters.CreationTime, NotifyFilter

 

enumeration, 362

 

NotifyFilters.DirectoryName, NotifyFilter

 

enumeration, 362

 

NotifyFilters.FileName, NotifyFilter

 

enumeration, 362

 

NotifyFilters.LastAccess, NotifyFilter

 

enumeration, 362

 

NotifyFilters.LastWrite, NotifyFilter

 

enumeration, 362

 

NotifyFilters.Security, NotifyFilter

 

enumeration, 362

 

NotifyFilters.Size, NotifyFilter

 

enumeration, 362

 

NotInheritable classes, 135

 

number data types, 108

 

numbers, 66–73

 

514 I N D E X

O

Object Browser window, 15 Object type, 466

object variable, 153 object-oriented (OO) language, 1, 3

object-oriented programming (OOP), 56 objects. See classes and objects

Of keyword, 331 OffRoader class, 130 okButton, 205

okButton_Click( ) function, 60

OO (object-oriented) language, 1, 3 OOP (object-oriented programming), 56 Opacity property, 236–237

Open dialog, 255

OpenFileDialog, 256

OpenForms array property, Application class, 234

OpenRead( ) method,

System.Net.WebClient, 465

OpenStream( ) method, 463

OpenWrite( ) method,

System.Net.WebClient, 465

operators, 67–71

option dialog boxes, Microsoft Word, 215 Output window, 15

overloading, 52 overrides keyword, 132 overriding methods, 56 overview, 227

P

Paint event, 238 parameterized types, 331 parameters, 138

Parent Container, 28

Parse( ) method, 69, 108, 206 parsed, 206

partial classes, 147–149, 316 PasswordChar property, Text Box, 198

PasswordsValid( ) function, 84 peeking, 357

Petzold, Charles, 4 plus symbol (+), 6 pointer, 153

polymorphism, 50–52, 110–113 popping, 357

predicate, 332 PrintSomethingClass class, 358 private variable, 125

process, 481

ProcessItem( ) method, 404 Product class, 349 <Product> element, 383 ProductKey object, 347 <ProductList> element, 383

ProductNumber class, 349, 353

Program class, HRActionDelegate delegate, 324 progress bar, 450

ProgressChanged( ) method, 469 ProgressChanged event, 470, 491–492 ProgressChanged property, 453 ProgressChangedEventArgs object, 466

ProgressChangedEventArgs.UserData

parameter, 491

ProgressPercentage property, 466 properties, 8

properties, in Windows applications, 190–192

properties and members getters and setters, 117–122 overview, 114–117

Properties list, 8

Properties window, 6, 8, 13, 15, 59, 173, 188, 192, 212, 262, 296, 364

property smart tags, 175–176 public keyword, 96

public methods, 147 pushing, 357

Q

Query Builder button, 438 Query Configuration Wizard, 440

Queue collection, System.Collections.Generics namespace, 331

R

RAD (Rapid Application Development) tool, 1

radio buttons, in Windows applications, 215–221

RadioButton, Microsoft Word, 215 RaiseEvent keyword, 324

Rapid Application Development (RAD) tool, 1 Read( ) method, 374, 378, 400

ReadAll( ) method, 370

ReadAllLines( ) method, 368

ReadBlock( ) method, 374

ReadByte( ) method, 378

ReadContentAs( ) method, XmlReader class, 400

ReadElementContentAs( ) method, XmlReader class, 400

ReadElementContentAsInt( ) method, 405 ReadElementContentAsString( ) method, 404

ReadElementString( ) method, XmlReader class, 400

ReadEndElement( ) method, XmlReader class, 401

Reader class, 371, 463 reading XML files, 399–406

ReadLine( ) method, 21, 50, 373

ReadStartElement( ) method, XmlReader class, 400

ReadSubTree( ) method, XmlReader class, 401, 404

ReadToDescendent( ) method, XmlReader class, 401

ReadToEnd( ) method, 463

ReadToFollowing( ) method, XmlReader class, 401–404

I N D E X 515

ReadToNextSibling( ) method, XmlReader

class, 401

 

recursion, 387

 

refactoring, 4

 

reference types, 153, 155

 

Regex object, 460

 

regexes, 463

 

Remove( ) method, 274, 332

 

RemoveAll( ) method, 332

 

RemoveAt( ) method, 267

 

replacements, 25

 

ReportProgress( ) method,

 

BackgroundWorker control, 488

 

Result property, 466

Find

result variable, 71, 109

it

RetireEmployee( ) methods, Employee

atfaster

return keyword, 106

class, 326

com.apress.http://superindex

Return statement, 83

 

Rows collection, 432, 434

 

RowState property, 435

 

RSS Bandit, 503

 

Run button, 9

 

RunWorkerAsync( ) method, 490

 

RunWorkerCompleted( ) method, 495

 

RunWorkerCompleted event, 492–493

 

S

 

Save( ) method, 308

 

Save menu, 305

 

SaveFileDialog, 256

 

SayHello( ) method, 111

 

scope, 96

 

scoping

 

overview, 122

 

private, 123–125

 

public, 122–123

 

static, 125–126

 

Screen Saver starter kit, 498

 

sealed class, 135

 

516I N D E X

searching XML documents, 389–399 Seek( ) method, 378

Select( ) method, XPathNavigator, 397 Select block, 86

Select statements, 85–86 SelectedIndex property, 273, 464 SelectedItem property, 273, 464 SelectedText property, Text Box, 199

SelectionLength property, Text Box, 199–200 SelectionMode property, 278

SelectionRange.End property, MonthCalendar control, 222

SelectionRange.Start property, MonthCalendar control, 222

SelectionStart property, Text Box, 199 SelectNodes( ) method, 391

sender object, 190 sender parameter, 196 separators, 298

Set Primary Key icon, 427 SetError( ) method, 214 SetName( ) method, 116, 119 SetStation( ) method, 123 setting Tab orders, 179–181 SetupTheCatalog( ) function, 351

SGML (Standard Generalized Markup Language), 383

Shadows keyword, 138–143 shared method, 50 ShortcutKeys property, 304 shortcuts, 299–305

Show( ) method, MessageBox class, 111, 219, 247, 250

Show All Files button, Solution Explorer, 173 Show Lines button, text boxes, 203

Show Selection button, 199 showButton control, Text Box, 199 ShowDialog( ) method, 256, 273 ShowInfo( ) method, 49

ShowMe( ) method, 64

Shown event, 238 ShowNodeToolTips property, 291

ShowToday property, MonthCalendar control, 222

ShowTodayCircle property, MonthCalendar control, 222

Simple style set, 280

SingleLine option, 461

Size.Height property, 191

Size.Width property, 191

Skip( ) method, XmlReader class, 401 smart tags, 28, 175

Solution Explorer, 13, 15

SomeElement element, 400

Sorted property, ListBox, 278

SortedDictionary collection, System.Collections.Generics namespace, 331

SortedList collection, System.Collections.Generics namespace, 331

sorting lists, 343, 345–346 SortTheList( ) method, 345 source code, 37–40 spiders, 359, 463

Split( )method, 120 SplitButton, tool strip, 313 SQL Server Express, 415, 429 square brackets, 463

Stack collection, System.Collections.Generics namespace, 331

staff.Find( ) method, 340

Standard Generalized Markup Language

(SGML), 383

Start Page window, 16 starter kits, 497–501

startingNum member variable, 489 startingNum shared variable, 496 StartsWith( ) method, 74

static methods, 125

status bars, 294, 312–314 StatusStrip control, 449 Stop( ) methods, 128

Stop Debugging button, Windows GUI, 160 stored procedures, 428

Stream class, 371 stream hierarchy, 371 Stream object, 463

StreamReader class, 373–374 streams

core concepts, 371 file streams, 372–378

network streams, 378–381 overview, 370–371

StreamWriter class, 374

String class, 74

String Collection Editor, 104, 262 string data, 73

string properties, 48 StringBuilder object, 200, 204 string.CompareTo( ) function, 345 strings, 73

StyleChanged event, 238 Sub Main( ) method, 21 subclassing, 51–56 submenus, 297 subroutines, 20, 39 Substring( ) method, 76–77

SupportsCancellation property, 493 _surname member, 121

surname value, 119 switch statement, 108 System namespace, 21

System.Collections.Generic namespace, 331 System.Collections.Generics namespace, 330 System.Exception, 157

System.IO namespace, 360, 366, 371 System.IO.File.ReadAllLines( ) method, 370 System.IO.File.WriteAllLines( ) method, 370

I N D E X 517

System.IO.NotifyFilters enumeration, 361

 

System.IO.Stream class, 371, 378

 

System.Net namespace, 21, 401

 

System.Net.WebClient framework, .NET,

 

457–458

 

System.Net.WebRequest class, 378

 

System.Object class, 63, 154

 

System.Object namespace, 330

 

System.Text.RegularExpressions, 77

 

System.Threading namespace, 485

 

System.Windows.Forms.Control, 190

 

System.Xml

 

overview, 384–389

Find

reading XML files, 399–406

 

searching XML documents, 389–399

it

System.Xml namespace, 384, 386, 402

faster

writing XML, 407–413

 

System.Xml.XPath namespace, 394

at

com.apress.http://superindex

T

 

Tab key, 17, 188

 

Tab Order item, 180

 

Tab Order mode, 181

 

Tab orders, setting, 179–181

 

TableAdapter Configuration Wizard, 438

 

Tables folder, 426

 

Task List window, 16

 

temporary projects, 12

 

text, entering in Windows applications

 

MaskedTextBox control, 208–210

 

overview, 197

 

text boxes, 197–208

 

Text property, 8, 31, 181, 191, 198, 217, 221,

 

223, 283

 

TextBox class, 128

 

TextBox control, 31

 

TextChanged event, Text Box, 198

 

The Mod operator, 71

 

threading

 

BackgroundWorker control, 485–495

 

518I N D E X

threading (continued) overview, 481–482

race conditions and deadlocks, 495–496 timers, 482–485

Throw keyword, 167 throwing exceptions, 165–168

ticketClass member variable, 221 Timer control, 482

timers, 482–485

tip boxes, IntelliSense, 181 title node, 399

TitleBackColor property, MonthCalendar control, 222

TitleForeColor property, MonthCalendar control, 222

ToLongDateString( ) method, 225 toolbars, 294, 312–314

Toolbox, 6, 15, 172 ToolStripMenuItems, 296

ToolTip help, adding in Windows applications, 211–215

ToolTips, 212, 290

ToString( ) method, 64, 267, 334, 460 ToUpper( ) method, 86

TreeNode object, 282, 290

TreeView control, 261

changing visual appearance of tree, 285–291

overview, 281–285

responding to selections and finding nodes, 292

TryParse( ) method, 108, 161, 206 types, 46–47

U

unboxing, 156 underscore symbol, 115 Until loop, 89

Update( ) method, 433, 436

UploadData( ) method,

System.Net.WebClient, 465

UploadFile( ) method, System.Net.WebClient, 465

UploadProgressChanged( ) method, 466

UploadString( ) method, System.Net.WebClient, 465

Url property, 454

user interface, building aligning controls, 176–178 overview, 171–175

setting Tab orders, 179–181

using property smart tags, 175–176

UserState method, ProgressChangedEventArgs, 491

V

Validated, MaskedTextBox, 210 Validating event, 189, 198, 205, 207, 210

ValidatingType property, MaskedTextBox, 210 value types, 153, 155

values, 346

variable-length parameter, 3 variables, 25, 48, 53, 114

arrays, 77–80 Boolean values, 73

characters and text, 73–74 If statements, 81–82

if statements, 82–84 loops

For loops, 90–91 overview, 86 While loops, 86–90

numbers, 66–73 overview, 63–66

Select statements, 85–86

VB. See Visual Basic

VB Express, 317

VB keywords, 81

View Detail, Windows GUI, 159

View menu, 16, 179

Vijaykumar, Walter, 472

virtual methods, 131–134 VisibleChanged event, 238 Visual Basic

basic structure, 35–36 control structures, 57

inheritance and polymorphism, 50–51 Mod operator, 285

source code, 37–40 types, 46–47

Visual Basic (VB) Express

IDE (integrated development environment)

overview, 4–6, 8–16 working with editors, 16–26

writing own web browser, 27, 29–32 overview, 1–4

Visual Studio Image Library, 302

Visual Web Developer, 4

Visual Web Developer Express, 502

W

watcher, FileSystemWatcher, 363 Web Browser window, 16

web browser, writing own, 27, 29–32 Web Reference Name dialog box, 478

Web Service Definition Language

(WSDL), 475

WebBrowser control, 27

accessing web through code, 456–465

handling other types of data with WebClient, 465–471

overview, 449–454 working with, 454–456

WebBrowserProgressChangedEventArgs

parameter, 453

WebClient class, 181–182, 385, 401, 459, 465–471

WebRequest class, 378–381 WebserviceX.NET, 480 while loops, 61, 86–90

I N D E X 519

whole numbers, 66

 

window docks, 13

 

windows

 

main window and how to remove it, 228

 

opening and closing, 230–235

 

overview, 227–228

 

styles, 236–237

 

Windows applications, building

 

adding ToolTip help, 211–215

 

buttons, 192–197

 

common properties and events, 190–192

 

date pickers, 221–226

 

entering text

itFind

overview, 197

MaskedTextBox control, 208–210

faster

text boxes, 197–208

 

how Windows programs work, 187–190

at

overview, 187

com.apress.http://superindex

radio buttons and check boxes, 215–221

 

Windows Clipboard, 198

 

Windows Forms project, 149

 

Windows user interface, 172

 

WinForms project, 243

 

WithEvents keyword, 318

 

Wordwrap property, Text Box, 198

 

WorkerSupportsCancellation property,

 

492, 495

 

WriteAllLines( ) method, 368

 

WriteAttributeString( ) method, 410

 

WriteElementString( ) method, 410

 

WriteEndDocument( ) method, 411

 

WriteEndElement( ) method, 409

 

WriteLine( ) method, 375

 

Writer class, 371

 

WriteStartDocument( ) method, 408

 

WriteStartElement( ) method, 409

 

writing XML, 407–413

 

WSDL (Web Service Definition Language), 475