You are on page 1of 26

Index

AL
Symbols +
addition arithmetic operator, 138

RI
! operator precedence, 144
Not logical operator, 139 overloading operator, 311–312
operator precedence, 144

TE
++
overloading operator, 312 overloading operator, 312
!= pre-increment arithmetic operator, 138

“”
Not Equals comparison operator, 141
overloading operator, 312
MA
+=
Add and Assign assignment operator, 142
add to, 51
Hello, 27 ,
D
string, 132 generic classes, 332
values, 406
TE

generic constraints, 334


% thousands separator numeric format, 180
field to value comparison, 406 variables, 130
GH

modulus arithmetic operator, 138 -


operator precedence, 144 negation arithmetic operator, 138
overloading operator, 312 operator precedence, 144
RI

& overloading operator, 312


And bitwise operator, 143 subtraction arithmetic operator, 138
And logical operator, 139
PY

--
operator precedence, 144 overloading operator, 312
overloading operator, 312 post-decrement arithmetic operator, 138
CO

&& -=
Conditional And logical operator, 139 Subtract and Assign assignment operator, 142
nested if statements, 223 subtract from, 51
operator precedence, 144 /
‘’ custom date/time format, 183
chars, 132 division arithmetic operator, 138
string values, 406 operator precedence, 144
* overloading operator, 312
field to value comparison, 406 :
multiplication arithmetic operator, 138 constructors, 294
operator precedence, 144 custom date/time format, 183
overloading operator, 312

487
; – ‘ABC’

; {}
properties, 26 Format, 177
section separato numeric format, 180 object initialization, 289
< statements, 220
field to value comparison, 406 |
Less Than comparison operator, 141 Or bitwise operator, 143
operator precedence, 144 Or logical operator, 139
overloading operator, 312 operator precedence, 144
<< overloading operator, 312
left shift bitwise operator, 143 ||
overloading operator, 312, 313 Conditional Or logical operator, 139
<= nested if statements, 223
field to value comparison, 406 operator precedence, 144
Less Than Or Equal To comparison ~
operator, 141 complement bitwise operator, 143
operator precedence, 144 overloading operator, 312
overloading operator, 312 _, accelerators, 59
= (), code clarity, 145
Assign assignment operator, 142 ., decimal separator numeric format, 180
And bitwise operator, 143 #, digit numeric format, 180
field to value comparison, 406 /=, Divide and Assign assignment operator, 142
variable value, 130 \, escape character numeric format, 180
== \\, escape sequence, 132
Equals comparison operator, 141 \“, escape sequence, 132
overloading operator, 312 \‘, escape sequence, 132
> \?, escape sequence, 132
field to value comparison, 406 \000, escape sequence, 132
Greater Than comparison <>, field to value comparison, 406
operator, 141 [], Format, 177
operator precedence, 144 %=, Logical And and Assign assignment
overloading operator, 312 operator, 142
>> |=, Logical Or and Assign assignment operator, 142
overloading operator, 312, 313 ^=, Logical Xor and Assign assignment
right shift bitwise operator, 143 operator, 142
>= ..., menus, 59
field to value comparison, 406 *=, Multiply and Assign assignment operator, 142
Greater Than Or Equal To comparison //, properties, 26
operator, 141 0, zero numeric format, 180
operator precedence, 144
overloading operator, 312
^
A
operator precedence, 144 \a, escape sequence, 132
overloading operator, 312 ‘ABC’
Xor bitwise operator, 143 custom date/time format, 183
Xor logical operator, 139 literal string numeric format, 180

488
accelerators – AvailableFreeSpace

accelerators, 469 properties, 39


menus, 59 Properties window, 39
AcceptButton, 119–120, 469 AnchorStyles, 26
dialogs, 115 AND, field to value comparison, 406
NewItemForm, 169 animation, properties, 450
accessibility, 469 anonymous type, 418, 469
fields, 167–168 API. See Application Programming Interface
private, 324 AppendAllText, File, 354
restricting, 168 Application Programming Interface (API), 450, 469
scope, 167–168 applications
accessibility solutions, 7
methods, 243 WPF, 451–454
properties, 272 archives, projects, 10
accessors, 469 ArgumentOutOfRangeException, 254
methods, classes, 271 arithmetic operators, 137–139
property, 273–275 arrays, 195–200, 469
breakpoints, 274 Fibonacci, 197, 472
null, 275 foreach loops, 232
Add indexes, 195–196
DateTime, 189 methods, 199–200, 249
List, 201 multi-dimensional, 198–199
SortedLists, 202 properties, 199–200
TimeSpan, 189 Sort, 199, 200, 328
Add New Data Source, Data menu, 395 values, 196–197, 263
Add New Item, Add Windows variables, 196
Form, 106 ArrayList, Remove, 201
Add Windows Form arrow keys, controls, 28
Add New Item, 106 ascending, 416
Project menu, 103–104 assembly, 469
AddDays, DateTime, 189 language, 4
AddExtension, OpenFileDialog, 95 assertions, 259–265, 469
AddHours, DateTime, 189 input, 259–261
AddMinutes, DateTime, 189 values array, 263
AddSeconds, DateTime, 189 assignment operators, 142
AddYears, DateTime, 189 Attributes
Align, Format menu, 29 DirectoryInfo, 352
alignment, Format, 177 FileInfo, 353
AllowDrop, 379 Auto Hide, Visual Studio IDE Properties
AllowFullOpen, ColorDialog, 94 window, 12
Alternate, 334–335 auto-implemented properties, 272
Anchor, 24, 469 autorun, interface, 484
AutoSize, 39 AutoSize, 24
Button, 39 Anchor, 39
design time, 39 Dock, 41
Label, 39 AutoSize = False, 122
LinkLabel, 39 AvailableFreeSpace, DriveInfo, 349

489
\b – Checked

B breakpoints, 152–153, 469


property accessors, 274
\b, escape sequence, 132 Brush
babelfish.yahoo.com, 387 GDI+, 443–445
BackColor, 24, 27 Pen, 442
Button, 105 bug, 151–160, 470. See also debugging
StatusStrip, 71 Button, 269, 477
TextBox, 23 Anchor, 39
BackgroundImage, 24 BackColor, 105
BackgroundWorker, 477 Click, 26, 47
backing fields, 469 DialogResult, 117
properties, 272–274 non-modal display, 111
base, constructors, 295 ToolStrip, 68
BASIC, 4 by reference. See references
BeginPrint, PrintDocument, 360 by value. See values
BevelBitmapEffect, BitmapEffect, 458 byte, 128, 470
binary operators, overloading, 313 byte
BinarySearch, Array, 200 data type, 128
bin\Debug, 9, 261 literal suffix characters, 131
BindingContext, 26
Find, 405–406
BindingNavigator, 398–399, 400, 477 C
BindingSource, 398, 477
C#, 470
CurrencyManager, 403, 405
C, currency format character, 179
RemoveFilter, 407
CAD. See computer aided design
Sort, 407
calculations, variables, 136–145
bin\Release, 261
camel casing, 23, 470
bit, 128, 469 CancelButton, 119–120, 470
Bitmap
DialogResult, 117
Graphics, 439
dialogs, 115
memory, 440 NewItemForm, 169
BitmapEffect
capitalization, Immediate window, 157
BevelBitmapEffect, 458
cascading if decision statements, 221–222
Image, 456
case, switch decision statement, 224
bitwise operators, 142–143 casting, data type values, 134
blank strings, 434 catch, 470
bool
event handlers, 47
Convert, 135
Center in Form, Format menu, 29
data type, 129 ChangeExtension, Path, 355
BorderStyle, 24
char, data type, 129
Bottom
chars, ‘’ (single quotes), 132
Anchor, 38
CheckBox, 477
Dock, 40
CheckedChanged, 51
BottomToolStripPanelVisible, 69
checked, data type values, 134
break, decision statements, 235–236
Checked, ToolStripMenuItem, 58

490
CheckedChanged – configuration

CheckedChanged, 51 ClickMeButton, Click, 50


CheckedListBox, 477 Clipboard, 369–375
CheckFileExists, OpenFileDialog, 95 StringCollection, 370–371
CheckOnClick, ToolStripMenuItem, 58 using, 371
CheckPathExists, OpenFileDialog, 95 clocks, StatusStrip, 70
child class, 283 Close, StreamWriter, 344
class, generic constraints, 333 Code Editor, event handlers, 26, 47
classes, 269–288, 470 code generalization, interfaces, 320–321
accessor methods, 271 code snippets, Visual Studio, 4
benefits, 270 code-behind, 451, 470
child, 283 codeToProtect, try-catch, 252
collections, 200–204 collections, classes, 200–204
encapsulation, 270 Color, 26–27
event handlers, 104 ColorDialog, 91, 94
events, 271, 276–280 FromName, 392
fields, 271 Pen, 442
fine-tuning, 301–310 ColorDialog, 89, 477
forms, 104–105 Color, 91
generic, 200–201, 331–339, 472 properties, 94
inheritance, 283–284 ColumnDefinitions, 454
generic constraints, 333 Combine, Path, 355
LINQ to SQL, 426–427 combo boxes, menus, 58
methods, 242, 271, 276 ComboBox, 477
new, 104 enumerations, 211
objects, 104, 269 SelectedIndexChanged, 52
overloading methods, 301 ToolStrip, 68
overriding methods, 302–304 comments, 26, 470
parent, 283 comparison operators, 141
polymorphism, 270, 284 overloading, 314
properties, 271–274 Component Tray, 470
references, 269 MenuStrip, 57
reusing code, 270 StatusStrip, 57
scope, 163–167 components, 20, 470
structures, 211–212, 269–270 compound assignment operators, 142, 470
Clear CompoundArray, Pen, 442
Array, 200 compression, projects, 10
Queue, 204 computer aided design (CAD), 470
RichTextBox, 82 concatenation, 470
SortedLists, 202 string operators, 140–141
Stack, 204 condition
Click, 51 do loops, 233
Button, 26, 47 if decision statement, 220
ClickMeButtonClick, 50 if-else decision statement, 221
events, 47 while loops, 232
sender, 48 configuration, IDE, 5

491
const – Cut

const, 145 remote forms, 107–109


constants, 145, 471 RichTextBox, 81
constraints, generic, 333–334 snap lines, 27–28
constructors, 471 Toolbox, 21
base, 295 WPF, 450, 454–455
default, 290, 471 scalability, 451
empty, 290, 471 conversion, data types, 133–136
inheritance, 294 Convert
invoking, 294–295 bool, 135
objects, 290–292 currency, 136
parameterized, 291–292 data type values, 135
parameterless, 290–291, 474 Coordinated Universal Time (UTC), 188, 471
generic constraints, 333 Copy
object initialization, 296 Array, 200
StreamWriter, 344–345 DragDropEffects, 381
this, 294–295 File, 354
Contains RichTextBox, 82
SortedLists, 202 copy, projects, 9–10
string, 175 CopyTo, FileInfo, 353
ContainsKey, SortedLists, 202 Create
ContainsText, overloading, 375 DirectoryInfo, 351
ContainsValue, SortedLists, 202 File, 354
context menus, 60 CreateDirectory, Directory, 352
ContextMenuStrip, 478 CreateGraphics, using, 439
Form Designer, 60 CreatePrompt, SaveFileDialog, 96
Properties window, 60 CreateSubdirectory, DirectoryInfo, 351
Continue (F5), Debug menu, 154 CreationTime
continue, decision statements, 235–236 DirectoryInfo, 352
controls, 19–35, 471 FileInfo, 353
arranging, 27–29, 37–45 Crystal Reports, 359
arrow keys, 28 currency
creating, 21–22 Convert, 136
dominant, 29, 471 decimal, 146
events, 20–21, 47, 51–52 Parse, 136
Form Designer, 21 CurrencyManager
Format menu, 28–29 BindingSource, 403, 405
Grid, 454 List.Count, 403
Layout toolbar, 28–29 CurrentCulture, 390
MaximumSize, 38 CustomEndCap, Pen, 442
methods, 20 customer care, 485
MinimumSize, 38 customization
names, 20, 23–24 dialogs, 115–123
properties, 20, 22–27 Visual Studio IDE, 13
Properties window, 22–23 CustomStartCap, Pen, 442
raise, 47 Cut, RichTextBox, 82

492
D – default constructor

D DateTime, 182, 189


methods, 188–190
D properties, 188–190
decimal format character, 179 TimeSpan, 190–191
long date format character, 181 variables, 187–188
d DateTime.Now, 184
custom date/time format, 182 DateTime.NowToShortDateString(), 148
short date format character, 181 DateTime.Now.ToShortTimeString(), 148
DashCap, Pen, 442 DateTimePicker, 194, 207, 478
DashOffset, Pen, 442 Day, DateTime, 189
DashPattern, Pen, 442 DayOfWeek, DateTime, 189
DashStyle, Pen, 443 DayOfYear, DateTime, 189
Data menu, Add New Data Source, 395 Days, DateTime, 190
data types, 471 .dbml, 426
conversion, 133–136 dd, custom date/time format, 182
delegates, 276 ddd, custom date/time format, 182
nullable, 429–430 dddd, custom date/time format, 182
promotion, 137 Debug
values, 128 Indent, 261
casting, 134 .NET Framework, 260
checked, 134 System.Diagnostics, 260
Convert, 135 WriteLine, 261
Parse, 135–136 Debug menu, 154–155
var, 413 shortcuts, 154
variables, 127–130 Debug.Assert, 260–261
databases, 395–409 debugging, 151–161
dataset, 398 Immediate window, 156–157
displaying record rows, 400–401 methods, 242
filtering, 406–407 watches, 155–156
LINQ to SQL, 423–426 decimal
record grids, 398–400 currency, 146
searching, 405–406 data type, 129–130
sorting, 407 literal suffix characters, 131
table adapter, 398 decision statements, 219–227
DataGridView, 398–399, 401, 478 break, 235–236
Dock, 402 cascading if, 221–222
DataObject, DoDrag, 378–379 continue, 235–236
datasets, 396, 471, 478 if, 220
databases, 398 if-else, 220–221
Visual Studio, 397 nested if, 222–223
DataSource, ListBox, 415 switch, 223–225
dataType, properties, 272 Decrypt
Date, 26 File, 354
DateTime, 189 FileInfo, 353
date formats, 181–184 default constructor, 290, 471

493
default – DragDropEffects.Copy

default, switch statement, 224–225 Dictionary, 203


DefaultExt, OpenFileDialog, 95 Direction, 273
deferred execution, 411, 471 direction
delegates get, 273
data types, 276 set, 273
event handlers, 278–280 directories
events, 276–278 OpenFileDialog, 92
private, 277 SaveFileDialog, 92
variables, 276 Directory, 352–353
Delete FileInfo, 353
Directory, 352 DirectoryInfo, 351–352
DirectoryInfo, 351 GetFiles, 419
File, 354 DirectX, 471
FileInfo, 353 WPF, 450
Dequeue, Queue, 204 Dispose
derive, 167, 283, 471 IDisposable, 293
descending, 416 StreamWriter, 344
DeselectAll, RichTextBox, 82 do, loops, 233–235
design time, 471 Dock, 24, 471
Anchor, 39 DataGridView, 402
properties, 29–30 properties, 40–41
Properties window, 50 Visual Studio IDE Properties window, 12
destructors, objects, 292–294 Dock = Botton, 122
dialogs, 89–102 Dock as Tabbed Document, Visual Studio IDE
AcceptButton, 115 Properties window, 12
CancelButton, 115 Document, PrintDialog, 96
customization, 115–123 DoDrag
displaying, 92–93 DataObject, 378–379
Filter, 96–97 DragDropEffects, 379
FilterIndex, 96–97 DomainUpDown, 478
forms, 91 dominant control, 29, 471
initialization, 91–92 doneTest, for loops, 229–230
MaximumSize, 116 double
MinimumSize, 116 data type, 129–130
properties, 93–96, 116 literal suffix characters, 131
return results, 92–93, 116–117 drag and drop, 377–384
ShowInTaskbar, 116 events, 377–378
tab order, 116 drag source, 377, 471
variables, 117 GiveFeedback, 378
DialogResult, 116–117, 256, 408, 471 QueryContinueDrag, 378
Button, 117 DragDrop
CancelButton, 117 drop target, 378, 379–380
IntelliSense, 93 e.Data, 380
ShowDialog, 116 DragDropEffects, DoDrag, 379
Dialogs tab, Toolbox, 91 DragDropEffects.Copy, 381

494
DragDropEffects.Move – event handlers

DragDropEffects.Move, 381 E, scientific notation format character, 179


DragEnter e.Data, DragDrop, 380
drop target, 378, 379–380 edit-and-continue, 152, 471
e.Effect, 380 editing area, Visual Studio IDE, 10
DragLeave, drop target, 378 e.Effect, DragEnter, 380
DragOver, drop target, 378 e.Graphics, 362
Drawable, 324 DrawString, 363
DrawArc, Graphics, 437–438 empty constructor, 290, 471
DrawBezier, Graphics, 438 Enabled, 25
DrawBeziers, Graphics, 438 ToolStripMenuItem, 58
DrawClosedCurve, Graphics, 438 encapsulation, 471
DrawCurve, Graphics, 438 classes, 270
DrawEllipse, 362 forms, 109
Graphics, 363, 438 methods, 242
DrawImage, Graphics, 438 Encrypt
drawing File, 354
GDI+, 437–448 FileInfo, 353
shapes, 360–362 EndCap, Pen, 443
text, 363 EndOfStream, StreamReader, 346
3D, 450 EndPrint, PrintDocument, 360
DrawLine, Graphics, 438 EndsWith, string, 175
DrawLines, Graphics, 438 Enqueue, Queue, 204
DrawPie, Graphics, 438 enumerations, 209–210, 471
DrawPolygon, 362 ComboBox, 211
Graphics, 363, 438 nullable data types, 430
DrawRectangle, 362 Environment.UserName, 148
Graphics, 437–438 E+O, scientific notation numeric format, 180
DrawRectangles, Graphics, 438 Equals, Object, 314
DrawString ErrorProvider, 20, 478
e.Graphics, 363 errors
Graphics, 438 exceptions, 251–252
DriveFormat, DriveInfo, 349 handling, 251–258
DriveInfo, 349–351 rounding, 129–130
DriveType, DriveInfo, 350 throwing, 254–255
drop target, 377–380 escape sequences, 132–133, 472
DropDownButton Euclid’s algorithm, 234, 472
StatusStrip, 71 evenQuery, LINQ, 412
ToolStrip, 68 event handlers, 47–55, 472
DropShadowBitmapEffect, 456 adding, 50–51
DVD contents, 483–485 catch, 47
classes, 104
Code Editor, 26, 47
E delegates, 278–280
e, 48 empty, 48
event handlers, 278 Form Designer, 26, 47
EventArgs, 49 forms, 104

495
EventArgs – float

making, 47–48 f
menus, 59 custom date/time format, 182
OutOfBounds, 278–280 full date, short time format character, 181
parameters, 48–49, 278 \f, escape sequence, 132
placeholders, 48 factorial, 206, 230, 243, 472
Properties window, 50 Factorial, methods, 244
RadioButton, 392 Fibonacci array, 197, 472
removing, 50–51 Field, control names, 24
user interface, 451 fields, 163, 472
variables, 107–108 accessibility, 167–168
EventArgs, e, 49 classes, 271
EventLog, 478 values, 406
events, 472 FIFO. See first-in-first-out
classes, 271, 276–280 File, 354–355
Click, 47 ReadAllText, 419
controls, 20–21, 47, 51–52 FileInfo, 353–354
delegates, 276–278 FileName
drag and drop, 377–378 OpenFileDialog, 91, 95
ex, try-catch, 252 SaveFileDialog, 91
Excel, 359 FileSystemWatcher, 478
exceptions, 472 Fill, Dock, 40
errors, 251–252 FillClosedCurve, Graphics, 438
try-catch, 252–254 FillEllipse, Graphics, 438
exceptionCode, try-catch, 252 FillPie, Graphics, 438
ExceptionType, try-catch, 252 FillPolygon, Graphics, 438
executables, IDE, 9 FillRectangleGraphics, 437–438
Exists FillRectangles, Graphics, 438
Directory, 352 Filter, 472
DirectoryInfo, 352 BindingSource, 406–407
File, 354 dialogs, 96–97
FileInfo, 353 OpenFileDialog, 95
Expression Blend, WPF, 449 Filter by State, 408
eXtensible Application Markup Language FilterIndex
(XAML), 452, 472, 475 dialogs, 96–97
editing, 456 OpenFileDialog, 95
Extension, FileInfo, 353 finallyCode, try-catch, 252
Find, BindingContext, 405–406
first-in-first-out (FIFO), 203, 474
F 5GL, 4
F FixedDialog, FormBorderStyle, 116
custom date/time format, 182 FixedDocument, WPF, 466
fixed-point format character, 179 FixedPitchOnly, FontDialog, 94
full date, long time format float
character, 181 data type, 129–130
literal suffix characters, 131

496
Float – get

Float, Visual Studio IDE Properties window, 12 remote


float.Parse, localization, 391 controls, 107–109
FlowDocument, WPF, 466 properties, 108
FlowLayoutPanel, 478 ShowInTaskbar, 110
FolderBrowserDialog, 89, 478 Solution Explorer, 103
properties, 94 startup, 107
SelectedPath, 91 types, 104
Font, 25 FORTRAN, 4
FontDialog, 91, 95 4GL, 4
FontDialog, 89, 478 from int num in numbers,
Font, 91 LINQ, 412
properties, 94–95 FromName, Color, 392
FontMustExist, FontDialog, 95 FullName
for, loops, 229–230 DirectoryInfo, 352
foreach, 421 FileInfo, 353
loops, 231–232 FullOpen, ColorDialog, 94
ForeColor, 25, 27 functions. See methods
StatusStrip, 71
Form Designer
ContextMenuStrip, 60
G
controls, 21 G
event handlers, 26, 47 general date/time, long time format
MenuStrip, 57 character, 181
SimpleEdit, 57 general format character, 179
snap lines, 27–28 g
Solution Explorer, 103 custom date/time format, 182
StatusStrip, 70 general date/time, short time format
ToolStrip, 68 character, 181
Format menu, controls, 28–29 garbage collector, 292–293, 472
Format, string, 176–184 GB. See gigabyte
formatString, Format, 177 GCD. See greatest common divisor
FormBorderStyle = FixedDialog, 122 GDI. See Graphics Device Interface
FormBorderStyle, FixedDialog, 116 GDI+
FormClosing, 51, 399–400, 401 Brush, 443–445
forms, 478 drawing, 437–448
classes, 104–105 Graphics, 437–441
creating, 103–105 Pen, 442–443
dialogs, 91 generations, languages, 4
displaying, 105–107 generic classes, 200–201, 331–339, 472
encapsulation, 109 generic constraints, 333–334
event handlers, 104 generic methods, 334–335
instances, 104–105 get
Load, 111 direction, 273
new, 105 properties, 272
variables, 105

497
GetAttributes – Image

GetAttributes, File, 354 Grid


getCode, 273 controls, 454
GetCreationTime Image, 454
Directory, 352 GroupBox, 38, 478
File, 354 Anchor, 39–40
GetDirectories
Directory, 352
DirectoryInfo, 351
H
GetDirectoryName, Path, 355 H, custom date/time format, 183
GetDirectoryRoot, Directory, 352 h, custom date/time format, 183
GetExtension, Path, 355 HatchBrush, 443–445
GetFileName, Path, 355 Height
GetFileNameWithoutExtension, Path, 355 StackPanel, 459
GetFiles WPF, 453
Directory, 352 Hello, “” (double quotes), 27
DirectoryInfo, 351, 419 HelpProvider, 478
GetHashCode, Object, 314 HH, custom date/time format, 183
GetKeyList, SortedLists, 202 hh, custom date/time format, 183
GetLastAccessTime Hide, Visual Studio IDE Properties window, 12
Directory, 352 Horizontal Spacing, Format menu, 29
File, 354 HorizontalAlignment, Image, 455, 459
GetLastWriteTime Hour, DateTime, 189
Directory, 353 Hours, DateTime, 190
File, 354 HScrollBar, 49, 478
GetParent, Directory, 353
GetTempFileName, Path, 355
GetTempPath, Path, 355
I
GetText, overloading, 375 IComparable, 321
GetValueList, SortedLists, 202 IDE. See integrated development environment
gigabyte (GB), 128, 472 IDisposable
GiveFeedback, drag source, 378 Dispose, 293
globalization, 388 StreamWriter, 344
GMT. See Greenwich Mean Time IDrawable, 324
Graphics, 362 IEnumerable, 415
Bitmap, 439 if
DrawEllipse, 363 cascading decision statements, 221–222
DrawPolygon, 363 decision statements, 220
GDI+, 437–441 nested decision statements, 222–223
Paint, 306 if-else, decision statements, 220–221
using, 441 IList<>, 320–321
Graphics Device Interface (GDI), 472. IList, ToArray, 415
See also GDI+ Image, 25
greatest common divisor (GCD), 233, 244, 472 BitmapEffect, 456
Greenwich Mean Time (GMT), 188 Grid, 454

498
ImageList – Kind

HorizontalAlignment, 455 IntelliSense, 4


Margin, 454 DialogResult, 93
PictureBox, 122 LoadFile, 83–84
Properties window, 459 overriding methods, 302
VerticalAlignment, 455 interfaces, 319–329, 472
WPF, 453 API, 450, 469
ImageList, 478 autorun, 484
Images, MouseDown, 453 code generalization, 320–321
Immediate window defining, 324
capitalization, 157 event handlers, 451
debugging, 156–157 GDI, 472
Import and Export Settings, 5 generic constraints, 333
IN, field to value comparison, 406 implementation, 321–323
Indent, Debug, 261 LINQ, 328
index, Format, 177 localization, 388–390
indexes, 472 multiple inheritance, 319–320
arrays, 195–196 names, 320
IndexOf placeholders, 323
Array, 200 internal, field accessibility value, 167
string, 175 InterpolationMode, Graphics, 441
IndexOfAny, string, 175 Interval, Timer, 52
inheritance IsDaylightSavingsTime,
classes, 283–284 DateTime, 189
generic constraints, 333 IsLeapYear, DateTime, 189
constructors, 294 IsPrime, 413
multiple, interfaces, 319–320 IsReadOnly, FileInfo, 354
InitialDirectory, OpenFileDialog, 95 IsReady, DriveInfo, 350
initialization, for loops, 229–230 Items, 25
initialization, objects, 289–300 items, foreach loops, 231
parameterless constructors, 296 Items.Add, ListBox, 119
InitializeComponent, 389 Items.Remove, ListBox, 119
input assertions, 259–261
Insert, string, 175
InsertOnSubmit, 428
J
installation, 4 Join, string, 176–177
instances, forms, 104–105
Load, 111
new, 105 K
variables, 105 KB. See kilobyte
int[], 196 KeyDown, 51
int, data type, 129 KeyPress, 51
integrated development environment (IDE), 472 KeyPreview, 374
configuration, 5 KeyUp, 51
executables, 9 kilobyte (KB), 128, 473
.sln, 7 Kind, DateTime, 189
Visual Studio, 3–18

499
Label – Locals window

L LineJoin, Pen, 443


LinkLabel, 38, 478
Label, 22, 38, 478 Anchor, 39–40
Anchor, 39 Dock, 41
Dock, 41 LINQ. See Language-Integrated Query
MessageForm, 112 LINQ to Dataset, 411
Text, 26 LINQ to Objects, 411
ToolStrip, 68 LINQ to SQL, 423–436
WPF, 461 classes, 426–427
languages code, 428
generations, 4 databases, 423–426
machine, 4, 473 Microsoft Access, 432–434
programming, 3, 343, 474 nullable data types, 429–430
SQL, 4 Properties window, 427
XAML, 452, 472, 475 SQL Server, 424
editing, 456 Toolbox, 432
Language-Integrated Query (LINQ), 473. See also LINQ to XML, 411
LINQ to SQL List, 201–202
interfaces, 328 lists, foreach loops, 231
objects, 409–421 ListBox, 38, 478
order by clause, 416 Anchor, 39–40
queries, 429–432 DataSource, 415
select clauses, 419 foreach loops, 231
where clause, 412–415 Items.Add, 119
LastAccessTime Items.Remove, 119
DirectoryInfo, 352 LINQ queries, 429
FileInfo, 354 SelectedIndexChanged, 52
LastIndexOf SelectedItem, 119
Array, 200 List.Count, CurrencyManager, 403
string, 176 List<string>, 320–321, 335
LastIndexOfAny, string, 176 List<T>, 335
last-in-first-out (LIFO), 204, 474 ListView, 168–172, 185, 329, 478
LastWriteTime ListViewItemSorter, 329
DirectoryInfo, 352 literal values, 131–133
FileInfo, 354 Load, 51
Layout toolbar, controls, 28–29 form instance, 111
LCM. See least common multiple LoadFile
least common multiple (LCM), 249 IntelliSense, 83–84
Left RichTextBox, 82
Anchor, 38 locale, 387–394, 473
Dock, 40 localization, 387–394, 473
LeftToolStripPanelVisible, 69 float.Parse, 391
Length, FileInfo, 354 interfaces, 388–390
LIFO. See last-in-first-out Parse, 391
LIKE, field to value comparison, 406 values, 390–391
LinearGradientBrush, 443–445 Locals window, 155

500
Location – methodName

Location, 25 memory, 128


Properties window, 28 Bitmap, 440
Location, New Project, 6 Paint, 440
logical operators, 139–140 menus, 57–66
long ... (ellipsis), 59
data type, 129 accelerators, 59
literal suffix characters, 131 combo boxes, 58
methods, 244 context, 60
loops, 229–239 creating, 57–58
for, 229–230 event handlers, 59
break, 235–236 separators, 58
continue, 235–236 shortcuts, 59
do, 233–235 textboxes, 58
foreach, 231–232 Visual Studio IDE, 10
tryingToLogin, 237 MenuStrip, 479
while, 232–233 Component Tray, 57
lower bound, 196, 473 Form Designer, 57
StatusStrip, 71
Toolbox, 57
M Visible, 403
M MessageBox.Show, 48
custom date/time format, 183 MessageForm, Label, 112
general date/time, long time format MessageQueue, 479
character, 181 methods, 241–250, 473
month day format character, 181 accessors, classes, 271
m advantages, 241–242
custom date/time format, 183 arrays, 199–200, 249
month day format character, 181 classes, 242, 271, 276
machine language, 4, 473 controls, 20
magic number, 145, 161, 473 DateTime, 188–190
Make Same Size, Format menu, 29 debugging, 242
MakeUserForm, 104, 106–107 encapsulation, 242
Margin generic, 334–335
Image, 454, 459 overloading, 83
values, 455 classes, 301
MaskedTextBox, 479 parameters, 245–246, 276
MaximizeBox = Fasle, 122 reusing code, 241–242
Maximum, Panel, 49 RichTextBox, 82–84
MaximumSize scope, 163, 473
controls, 38 variables, 165–166
dialogs, 116 string, 175–177
MaxSize, FontDialog, 95 syntax, 242–245
MB. See megabyte TimeSpan, 190–191
megabyte (MB), 128, 473 methodName, methods, 243

501
Microsoft Access – non-deterministic finalization

Microsoft Access, 426 multi-dimensional arrays, 198–199


LINQ to SQL, 432–434 Multiline, 38, 205
Millisecond, DateTime, 190 multimedia, WPF, 450
Milliseconds, DateTime, 191 multiple inheritance, interfaces, 319–320
MinimizeBox = False, 122 MySQL, 397, 426
MinimumSize
controls, 38
dialogs, 116
N
Minute, DateTime, 190 N, currency format character, 179
Minutes, DateTime, 191 \n, escape sequence, 132
MM, custom date/time format, 183 N factorial, 243
mm, custom date/time format, 183 Name
MMMM, custom date/time format, 183 LINQ to SQL Properties window, 427
modal display, 473 New Project, 6
ShowDialog, 106 Name, 25
modeless, 473 DirectoryInfo, 352
Modifiers DriveInfo, 350
nameTextBox, 119 FileInfo, 354
TextBox, 112 properties, 272
Month, DateTime, 190 ToolStripMenuItem, 58
MonthCalendar, 479 WPF, 453
MouseClick, 26, 51 names
e, 49 controls, 20, 23–24
Panel, 49 interfaces, 320
MouseDown, 51 namespace, 260, 319, 371, 473
e, 49 nameTextBox, Modifiers, 119
Images, 453 nested if decision statements, 222–223
MouseEnter, 52 nested scope, 166–167
MouseHover, 52 .NET Framework, 3
MouseLeave, 52 Debug, 260
MouseMove, 52 dialogs, 90
e, 49 runtime libraries, 9
Panel, 49 new
mousePictureBox, 49 classes, 104
MouseUp, 52 forms instance, 105
e, 49 new(), generic constraints, 333
Move, 52 New Project, 5–9
Directory, 353 NewItemForm
DragDropEffects, 379, 381 AcceptButton, 169
File, 355 CancelButton, 169
moveLabelButton, 26 next, for loops, 230
MoveTo nextPageNum, 362
DirectoryInfo, 351 nibbles, 128, 473
FileInfo, 353 non-deterministic finalization, 293, 473

502
None – PageSetupDialog

None, Dock, 40 operands, operators, 137


non-modal display operators, 137–145
Button, 111 arithmetic, 137–139
Show, 106 assignment, 142
NOT, field to value comparison, 406 binary, overloading, 313
NotifyIcon, 479 bitwise, 142–143
Now, DateTime, 190 comparison, 141
null overloading, 314
property accessors, 275 compound assignment, 142, 470
references, 430 logical, 139–140
nullable data types, 473 operands, 137
LINQ to SQL, 429–430 overloading, 311–318, 473
Nullable, LINQ to SQL precedence, 143–145
Properties window, 427 string, 140–141
Source, 432 unary, overloading, 312
number, methods, 244 OR, field to value comparison, 406
NumberStyles.Any, 136, 263, 473 Oracle, 397, 426
numeric formats, 179–180 order by clause, 473
custom, 180 LINQ, 416
NumericUpDown, 24, 146–147, 230, 479 Order, Format menu, 29
Orientation, StackPanel, 459
out, parameters, 246
O OutOfBounds, event handlers, 278–280
O, round trip format character, 181 overloading, 473
Object binary operators, 313
Equals, 314 comparison operators, 314
GetHashCode, 314 ContainsText, 375
Object Browser, 323 GetText, 375
object, data type, 129 methods, 83
objects classes, 301
classes, 104, 269 operators, 311–318, 473
constructors, 290–292 unary operators, 312
destructors, 292–294 overriding methods, 473
initialization, 289–300 classes, 302–304
parameterless constructors, 296 IntelliSense, 302
LINQ, 409–421 ToString, 303, 333
references, 105 OverwritePrompt,
ToolStrip, 68 SaveFileDialog, 96
ToString, 178
Offset submenu, 57
1GL, 4
P
OpenFileDialog, 89, 90, 97, 479 P, percent format character, 179
directories, 92 PadLeft, string, 176
FileName, 91 PadRight, string, 176
properties, 95 PageSetupDialog, 89, 479

503
Paint – projecting data

Paint, 52 placeholders
Graphics, 306 event handlers, 48
memory, 440 interfaces, 323
Panel, 49, 479 Visual Studio, 323
parameterized constructors, 291–292 Point, 26
parameterless constructors, polymorphism, 474
290–291, 474 classes, 270, 284
generic constraints, 333 Pop, Stack, 204
object initialization, 296 precedence, operators, 143–145
parameters precision specifier, 179, 474
event handlers, 48–49, 278 Primary Key, LINQ to SQL Source, 432
generic classes, 332 PrintDialog, 89, 479
methods, 245–246, 276 properties, 96
out, 246 WPF, 461–466
ref, 246 PrintDocument, 359–360, 479
references, 245–246 PrintPreviewDialog, 364–365
return, 246 WPF, 466
values, 249 printing, 359–368
parameters, methods, 243 WPF, 461–468
parent class, 283 Printing tab, Toolbox, 91
Parent, DirectoryInfo, 352 PrintPage, PrintDocument, 360
parse, 147, 391, 474 PrintPreviewControl, 479
Parse PrintPreviewDialog, 89, 479
currency, 136 PrintDialog, 96
data type values, 135–136 PrintDocument, 364–365
DateTime, 189 properties, 96
localization, 391 PrintVisual
Pascal casing, 20, 23, 474 this, 462
passwords, 237 WPF, 461–466
Paste, RichTextBox, 82 PrintWindowCentered, 464
Path, 355 private
Path.Combine, 373 accessibility, 324
PathGradientBrush, 443–445 delegate, 277
Peek field accessibility value, 167
Queue, 204 interfaces, 324
Stack, 204 methods, 244
Pen, GDI+, 442–443 private variables, 109
PerformanceCounter, 479 Process, 480
PictureBox, 445, 479 programming language, 3, 343, 474
Anchor, 39–40 ProgressBar, 480
Image, 122 StatusStrip, 70
Panel, 49 ToolStrip, 68
pinning, windows, 12 Project menu, Add Windows Form, 103–104
pixels, 22, 25, 26, 440, 474 projecting data, 416

504
projecting LINQ query – ReadOnlyChecked

projecting LINQ query, 416, 474 event handlers, 50


projects Image, 459
archives, 10 LINQ to SQL, 427
compression, 10 Location, 28
copy, 9–10 Visual Studio IDE, 11–12
new, 5–9 WPF, 453
Projects folder, 7 PropertyGrid, 480
promotion, data types, 137 protected, field accessibility value, 167
properties protected internal, field accessibility value, 167
// (double slashes), 26 public
; (semi-colon), 26 field accessibility value, 167–168
accessors, 273–275 interfaces, 324
breakpoints, 274 public variables, 109
null, 275 Push, Stack, 204
Anchor, 39
animation, 450
arrays, 199–200
Q
auto-implemented, 272 queries, LINQ, 429–432
backing fields, 272–274 QueryContinueDrag, drag source, 378
classes, 271–274 QueryPageSettings, PrintDocument, 360
ColorDialog, 94 queue, 203, 474
controls, 20, 22–27 Queue, 203–204
DateTime, 188–190
design time, 29–30
dialogs, 93–96, 116 R
Dock, 40–41 R
FolderBrowserDialog, 94 RFC1123 format character, 181
FontDialog, 94–95 round trip format character, 179
modifying, 26–27 \r, escape sequence, 132
OpenFileDialog, 95 r, RFC1123 format character, 181
PrintDialog, 96 RadioButton, 480
PrintPreviewDialog, 96 CheckedChanged, 51
remote forms, 108 event handlers, 392
RichTextBox, 79–81 TextBox, 409
SaveFileDialog, 96 raise, 20, 474
TimeSpan, 190–191 controls, 47
ToolStripMenuItem, 58 events, 427
values, 157 range variable, 412, 474
Visual Studio IDE, 11 ReadAllBytes, File, 355
Properties window ReadAllLines, File, 355
Anchor, 39 ReadAllText, File, 355, 419
ContextMenuStrip, 60 reading files, 345–346
controls, 22–23 ReadLine, StreamReader, 345
design time, 50 ReadOnlyChecked, OpenFileDialog, 95

505
ReadToEnd – select clauses

ReadToEnd, StreamReader, 345 Right


Recent Projects, 7 Anchor, 38
Rectangle rect, 306 Dock, 40
Rectangle, ViewBox, 464 RightToolStripPanelVisible, 69
recursive method, 249, 474 robustness, 259–265
Redo, RichTextBox, 82 switch statement, 223–225
ref, parameters, 246 Root, DirectoryInfo, 352
refactoring, 4, 73, 474 RootDirectory, DriveInfo, 350
references, 470, 474 RootFolder, FolderBrowserDialog, 94
classes, 269 rounding errors, 129–130
null, 430 Rtf, RichTextBox, 81
objects, 105 runtime, 359, 474
parameters, 245–246 libraries, .NET Framework, 9
relatively prime, 224, 474
remainder, do loop, 234
remote forms
S
controls, 107–109 s
properties, 108 custom date/time format, 183
Remove sortable date/time format character, 181
ArrayList, 201 same name variables, 164–165
List, 201 SaveFile, 84
SortedLists, 202 RichTextBox, 82
string, 176 SaveFileDialog, 89, 90, 480
RemoveAt, List, 202 directories, 92
RemoveFilter, BindingSource, 407 FileName, 91
Replace, string, 176 FilterIndex, 97
Resize, 52 properties, 96
Array, 200 sbyte
result, methods, 244 data type, 128
return literal suffix characters, 131
methods, 243 scalability, WPF controls, 451
parameters, 246 scope, 163–173, 474
returnType, methods, 243 accessibility, 167–168
returnValue, methods, 243 classes, 163–167
reusing code do loop, 234
classes, 270 methods, 163, 473
methods, 241–242 variables, 165–166
Reverse, Array, 200 nested, 166–167
RichTextBox, 79–87, 480 restricting, 168
controls, 81 Scroll, 52
methods, 82–84 Second, DateTime, 190
properties, 79–81 Seconds, DateTime, 191
TextBox, 79 select clauses, 474
ToolStripContainer, 73 LINQ, 419
queries, 429

506
select num – SortedDictionary

select num, LINQ, 412 SetLastWriteTime


SelectAll, RichTextBox, 82 Directory, 353
SelectedIndexChanged, 52 File, 355
SelectedItem, ListBox, 119 SetText, Clipboard, 369
SelectedPath, FolderBrowserDialog, 91, 94 shapes
SelectedRtf, RichTextBox, 81 drawing, 360–362
SelectedText, RichTextBox, 81 switch, 362
SelectionAlignment, RichTextBox, 80 short
SelectionBackColor, RichTextBox, 80 data type, 128
SelectionBullet, RichTextBox, 80 literal suffix characters, 131
SelectionCharOffset, RichTextBox, 80 ShortcutKeys, ToolStripMenuItem, 58
SelectionColor, RichTextBox, 80 shortcuts, 474
SelectionFont, RichTextBox, 80 Debug menu, 154
SelectionHangingIndent, RichTextBox, 80 menus, 59
SelectionIndent, RichTextBox, 80 Show, 105
SelectionLength, RichTextBox, 79 non-modal display, 106
SelectionProtected, RichTextBox, 80 ShowColor, FontDialog, 95
SelectionRightIndent, RichTextBox, 80 ShowDialog, 92, 105
SelectionStart, RichTextBox, 79 DialogResult, 116
sender modal display, 106
Click, 48 WPF, 461–466
event handlers, 278 ShowEffects, FontDialog, 95
Separator, ToolStrip, 68 ShowInTaskbar
separators, menus, 58 dialogs, 116
SerialPort p, 480 forms, 110
Server Data Type, LINQ to SQL ShowReadOnly, OpenFileDialog, 95
Properties window, 427 side effects, 140, 474
Source, 432 SimpleEdit, Form Designer, 57
Server Explorer, 425 Size, 25
ServiceController, 480 .sln, IDE, 7
set smart tags, 69
direction, 273 SmoothingMode, Graphics, 441
properties, 272 snap lines, Form Designer, 27–28
SetAttributes, File, 355 SolidBrush, 443–445
SetAudio, Clipboard, 369 solutions, applications, 7
setCode, 273 Solution Explorer
SetCreationTime Form Designer, 103
Directory, 353 forms, 103
File, 355 Visual Studio IDE, 10
SetFileDropList, Clipboard, 369 Solution Name, New Project, 6
SetImage, Clipboard, 369 Sort
SetLastAccessTime arrays, 199, 200, 328
Directory, 353 BindingSource, 407
File, 355 SortedDictionary, 203

507
SortedList – syntax

SortedList, 202–203 streams, 343–344, 475


SoundPlayer, System.Media, 371 StreamReader, 345–346
Source EndOfStream, 346
Image, 459 ReadLine, 345
LINQ to SQL, 427, 432 ReadToEnd, 345
LINQ to SQL Source, 433 using, 346
Split, string, 176 StreamWriter, 344–345
SplitButton Close, 344
StatusStrip, 71 Dispose, 344
ToolStrip, 68 IDisposable, 344
SplitContainer, 44, 480 using, 346
splitter, 44, 474 Write, 344
SQL Server, 397 WriteLine, 345
LINQ to SQL, 424 Stretch
SQL Server Express, 397 Image, 459
SQL Server Management Studio, 425 WPF, 453
ss, custom date/time format, 183 string, 175–185
stack, 474 “” (double quotes), 132
Stack, 204 blank, 434
StackPanel, 458–459 data type, 129
Start Debugging, 7–8 Format, 176–184
StartCap, Pen, 443 methods, 175–177
StartsWith, string, 176 ToString, 177–184
startup forms, 107 string[], 321
statement, if decision statement, 220 string operators, 140–141
statements StringCollection
do loops, 233 Clipboard, 370–371
foreach loops, 231 System.Collections, 371
for loops, 230 string.Format, 184
methods, 243 strong type checking, 475
while loops, 232 struct, generic constraints, 333
statementsIfFalse, if-else decision Structured Query Language (SQL), 4
statement, 221 structures, 210–211, 475
statementsIfTrue, if-else decision classes, 211–212, 269–270
statement, 221 nullable data types, 430
static methods, 352, 355, 369, 475 values, 269
StatusLabel, StatusStrip, 70 styles, WPF, 450, 456–458
StatusStrip, 70–77, 480 submenus, Type Here, 58
clocks, 70 SubmitChanges, 428
Component Tray, 57 Substring, string, 176
Form Designer, 70 switch
Step Into (F11), Debug menu, 154 decision statements, 223–225
Step Out ([Shift]+F11), Debug menu, 154 shapes, 362
Step Over (F10), Debug menu, 154 syntax, methods, 242–245

508
system requirements – ToolStripButtons

system requirements, 483–484 TextChanged, 52


System.Collections, TextDataFormat, 375
StringCollection, 371 TextRenderingHint,
System.Diagnostics Graphics, 441
Debug, 260 TextureBrush, 443–445
using, 260 this
System.Media, SoundPlayer, 371 constructors, 294–295
System.Object, ToString, 303 PrintVisual, 462
System.Windows.Forms.DialogResult, 93 this.Close(), 73
RichTextBox, 82
3D drawing, WPF, 450
T 3GL, 4
t throwing, errors, 254–255
custom date/time format, 183 Tick, 52
short time format character, 181 TimeOfDay, DateTime, 190
<T>, 332 Timer, 20, 480
\t, escape sequence, 132 Interval, 52
T, short time format character, 181 TimeSpan
tab order, dialogs, 116 Add, 189
TabControl, 480 DateTime, 190–191
table adapter, databases, 398 methods, 190–191
TableLayoutPanel, 480 properties, 190–191
Tag, 25 Title, OpenFileDialog, 95
TB. See terabyte ToArray, IList, 415
templates, WPF, 450–451 Today, DateTime, 190
terabyte (TB), 128, 475 ToLocalTime, 188
testValue, Switch decision DateTime, 189
statement, 224 ToLongDateString, 182
Text, 25 ToLongTimeString, 182
Label, 26 ToLower, string, 176
RichTextBox, 81 toolbars
ToolStripMenuItem, 58 Layout, 28–29
text, drawing, 363 Visual Studio IDE, 10
TextAlign, 25 Toolbox
TextBox, 19–20, 22, 38, 480 controls, 21
Anchor, 39–40 Dialogs tab, 91
BackColor, 23 LINQ to SQL, 432
database records, 400 MenuStrip, 57
Modifiers, 112 Printing tab, 91
RadioButton, 409 Visual Studio IDE, 10
RichTextBox, 79 ToolStrip, 67–70, 480
ToolStrip, 68 Form Designer, 68
WPF, 461 objects, 68
textboxes, menus, 58 ToolStripButtons, 47

509
ToolStripContainer – values

ToolStripContainer, 69–70, 480 U


RichTextBox, 73
ToolStripMenuItem, 58 U, universal sortable full date/time format
ToolStripMenuItems, 47 character, 182
ToolTip, 20, 304, 480 u, universal sortable short date/time format
Top character, 181
Anchor, 38 uint
Dock, 40 data type, 129
TopToolStripPanelVisible, 69 literal suffix characters, 131
ToShortDateString, 182 ulong
ToShortTimeString, 182 data type, 129
ToString, 182 literal suffix characters, 131
DateTime, 189, 191 unary operators, overloading, 312
LINQ queries, 429 Undo, RichTextBox, 82
objects, 178 upper bound, 196, 475
overriding methods, 303, 333 user interface, event handlers, 451
string, 177–184 username, 237
System.Object, 303 ushort
TotalDays, DateTime, 191 data type, 128
TotalFreeSpace, DriveInfo, 350 literal suffix characters, 131
TotalHours, DateTime, 191 using
TotalMilliseconds, DateTime, 191 Clipboard, 371
TotalMinutes, DateTime, 191 CreateGraphics, 439
TotalSeconds, DateTime, 191 Graphics, 441
TotalSize, DriveInfo, 350 StreamReader, 346
ToUniversalTime, 188 StreamWriter, 346
DateTime, 189 System.Diagnostics, 260
ToUpper, string, 176 variableInitialization, 293
TrackBar, 481 UTC. See Coordinated
Scroll, 52 Universal Time
transforming data, 416 UtcNow, DateTime, 190
transforming LINQ query, 475
TreeNode, 331–333 V
TreeView, 397, 481
Trim, string, 176 \v, escape sequence, 132
TrimEnd, string, 176 ValidateNames, SaveFileDialog, 96
TrimStart, string, 176 Value, control names, 24
try-catch, exceptions, 252–254 ValueChanged, 52
try-catch-finally, 253 values, 470
tryingToLogin, loops, 237 arrays, 196–197, 263
tt, custom date/time format, 183 data types, 128
2GL, 4 casting, 134
Type Here, submenus, 58 checked, 134
Type, LINQ to SQL Source, 433 Convert, 135
types, forms, 104 Parse, 135–136

510
var – Windows Presentation Foundation

fields, 406 Visual Studio, 475


literal, 131–133 code snippets, 4
localization, 390–391 dataset, 397
Margin, 455 IDE, 3–18, 10
nullable data types, 430 customization, 13
parameters, 249 placeholders, 323
properties, 157 WPF, 449
structures, 269 VisualBrush, Window, 464
variables, 105, 127, 130 VolumeLabel, DriveInfo, 350
watches, 155–156 VScrollBar, 49, 481
var
data types, 413
LINQ, 412
W
variableDeclaration, foreach watches, debugging, 155–156
loops, 231 WebBrowser, 481
variableInitialization, where (num % 2==0), LINQ, 412
using, 293 where clause, 475
variables, 105, 127–149 LINQ, 412–415
arrays, 196 where, generic constraints, 333
calculations, 136–145 while, loops, 232–233
data types, 127–130 Width
DateTime, 187–188 Image, 459
declaring, 130 Pen, 443
delegates, 276 StackPanel, 459
dialogs, 117 WPF, 453
event handlers, 107–108 Window, 451, 453
form instance, 105 VisualBrush, 464
method scope, 165–166 Windows Forms, 6
private, 109 windows, pinning, 12
public, 109 Windows Presentation Foundation (WPF),
range, 412, 474 359, 449–460
reading, 153–154 applications, 451–454
same name, 164–165 controls, 450, 454–455
values, 105, 127, 130 scalability, 451
watches, 155–156 DirectX, 450
verbatim string literals, 133, 475 Expression Blend, 449
Vertical Spacing, Format menu, 29 FixedDocument, 466
VerticalAlignment, Image, 455, 459 FlowDocument, 466
ViewBox, Rectangle, 464 Label, 461
virtual, 475 PrintDialog, 461–466
Visible, 25 PrintDocument, 466
MenuStrip, 403 printing, 461–468
Visual C#, 3, 475 PrintVisual, 461–466
Windows Forms, 6 Properties window, 453

511
Word – zzz

ShowDialog, 461–466 \xhh, escape sequence, 132


styles, 456–458 \xhhhh, escape sequence, 132
TextBox, 461 XML Paper Specification (XPS), 464
Visual Studio, 449 XPS. See XML Paper Specification
Word, 359
WPF. See Windows Presentation Foundation
Write, StreamWriter, 344
Y
WriteAllBytes, File, 355 y
WriteAllLines, File, 355 custom date/time format, 183
WriteAllText, File, 355 year month format character, 182
WriteLine Y, year month format character, 182
Debug, 261 Year, DateTime, 190
StreamWriter, 345 yy, custom date/time format, 183
writing files, 344–345 yyy, custom date/time format, 183
yyyy, custom date/time format, 183

X
X, hexadecimal format character, 179
Z
x++, operator precedence, 144 z
++x, operator precedence, 144 checked, 134
x--, operator precedence, 144 custom date/time format, 183
--x, operator precedence, 144 zz, custom date/time format, 183
XAML. See eXtensible Application zzz, custom date/time format, 183
Markup Language

512