Windows Forms Programming with C#

Free Download

Authors:

Edition: 1st

ISBN: 9781930110281, 1930110286

Size: 14 MB (15075078 bytes)

Pages: 755/755

File format:

Language:

Publishing Year:

Category: Tags: , ,

Erik Brown9781930110281, 1930110286

The new C# language and Internet software services have received much of the attention surrounding Microsoft’s new .NET environment. However, Microsoft has also redesigned the way Windows desktop applications will be created and deployed in the future. Intended as a tutorial for C++ and Java programmers at all levels, this book shows how C# and the .NET framework can be used to develop Windows applications with .NET.
Brown has put a lot of thought into covering the mass of practical bases in Windows .NET Forms development. The concept of developing one application through the course of the book to show clearly and in context how each piece fits and works, while not new, is done superbly in this book. I learned much, much more from this book about not only Windows Forms but about C# programming in general than from several other dedicated C# books I have. His approach to showing the code and code changes and explaining them in step-by-step and in side-by-side panels is outstanding tutorial style.

Table of contents :
Inside front cover……Page 2
Part 3 Advanced Windows Forms437……Page 9
contents……Page 11
preface……Page 19
The Windows Forms namespace……Page 21
Part 2: Basic Windows Forms……Page 22
Part 3: Advanced Windows Forms……Page 23
Who should read this book?……Page 24
Result……Page 25
Author online……Page 27
acknowledgments……Page 28
about .NET……Page 30
Casting the .NET……Page 31
Windows Forms overview……Page 32
about the cover illustration……Page 34
Hello Windows Forms……Page 37
Getting started with Windows Forms……Page 39
1.1 Programming in C#……Page 40
1.1.1 Namespaces and classes……Page 42
1.1.2 Constructors and methods……Page 44
1.1.3 C# types……Page 45
1.1.5 The Application class……Page 47
1.2 Adding controls……Page 49
1.2.1 Shortcuts and fully qualified names……Page 51
1.2.2 Fields and properties……Page 52
1.3 Loading files……Page 54
1.3.1 Events……Page 56
1.3.2 The OpenFileDialog class……Page 58
1.3.3 Bitmap images……Page 60
1.4 Resizing forms……Page 62
1.4.1 Desktop layout properties……Page 64
1.4.2 The Anchor property……Page 65
1.4.3 The Dock property……Page 67
1.5 Recap……Page 69
Getting started with Visual Studio .NET……Page 70
2.1 Programming with Visual Studio .NET……Page 71
2.1.1 Creating a project……Page 72
Result……Page 73
2.1.3 Viewing the source code……Page 75
Result……Page 76
2.2.1 The AssemblyInfo file……Page 79
Results……Page 81
2.2.2 Renaming a form……Page 82
Result……Page 83
2.2.3 The Toolbox window……Page 84
Result……Page 86
2.3.1 Event handlers in Visual Studio .NET……Page 90
Result……Page 91
2.3.2 Exception handling……Page 94
Result……Page 96
2.4 Resizing forms……Page 97
Result……Page 99
Result……Page 100
2.5 Recap……Page 101
Basic Windows Forms……Page 103
Menus……Page 105
3.1 The nature of menus……Page 106
3.1.2 The Menu class hierarchy……Page 107
3.1.3 Derived classes……Page 109
3.2.1 Adding the Main menu……Page 110
Result……Page 111
Result……Page 113
3.2.3 Adding the dropdown menu……Page 115
Result……Page 119
Result……Page 120
Result……Page 121
3.3.2 Adding handlers via the properties window……Page 122
Result……Page 123
3.4 Popup events and shared handlers……Page 124
Result……Page 125
Result……Page 127
Result……Page 128
3.4.2 Handling Popup events……Page 129
Result……Page 130
3.5 Context menus……Page 133
Result……Page 134
Result……Page 136
3.6 Recap……Page 137
Status bars……Page 138
4.1 The Control class……Page 139
4.2 The StatusBar class……Page 141
Result……Page 142
Result……Page 145
4.3 Status bar panels……Page 146
Result……Page 147
Result……Page 152
4.4.1 The DrawItem event……Page 154
Result……Page 157
4.5 Recap……Page 161
Reusable libraries……Page 162
5.1 C# classes and interfaces……Page 163
5.1.1 Interfaces……Page 164
5.1.2 Data collection classes……Page 165
5.2 Class libraries……Page 169
Result……Page 170
Result……Page 172
Result……Page 173
5.2.2 Using the command-line tools……Page 174
5.2.3 Creating the PhotoAlbum class……Page 175
Result……Page 176
Result……Page 177
Result……Page 178
Result……Page 180
5.3 Interfaces revisited……Page 181
5.3.2 Supporting the IList interface……Page 182
Result……Page 183
5.3.3 Implementing album position operations……Page 184
Result……Page 185
Result……Page 186
5.4.1 Handling an invalid bitmap……Page 187
Result……Page 188
5.4.2 Overriding methods in the Object class……Page 190
Result……Page 191
5.4.3 Disposing of resources……Page 193
Result……Page 194
Result……Page 195
5.5 Recap……Page 196
Common file dialogs……Page 197
6.1.1 Changing the menu bar……Page 198
Results……Page 199
Result……Page 200
Result……Page 201
6.2.1 Adding images to an album……Page 202
Result……Page 203
6.3 Paint events……Page 205
6.3.1 Drawing the current photograph……Page 206
6.3.2 Displaying the current position……Page 207
Result……Page 208
6.4 Context menus revisited……Page 209
6.4.2 Displaying the previous photograph……Page 210
6.5.1 Creating a default album directory……Page 211
Result……Page 213
Result……Page 215
6.5.3 Handling the New menu……Page 216
6.6 Save file dialogs……Page 217
6.6.1 Writing album data……Page 218
Result……Page 219
Result……Page 220
6.6.2 Saving an album as a new file……Page 222
6.6.3 Saving an existing album……Page 224
6.7 Open file dialogs……Page 225
Result……Page 226
6.7.2 Opening an album file……Page 227
Result……Page 228
6.8 Recap……Page 229
Drawing and scrolling……Page 230
7.1 Form class hierarchy……Page 231
7.1.2 The Form class……Page 232
7.2.1 Deleting the PictureBox control……Page 234
Result……Page 235
7.2.3 Implementing the Stretch to Fit option……Page 238
Result……Page 239
7.2.4 Implementing a Scale to Fit option……Page 241
Result……Page 243
Result……Page 244
Result……Page 245
7.2.5 Repainting when the form is resized……Page 246
Result……Page 247
7.3 Automated scrolling……Page 248
7.3.2 Implementing automated scrolling……Page 249
Result……Page 250
7.4 Panels……Page 251
Result……Page 253
Result……Page 254
Result……Page 255
Result……Page 256
Result……Page 257
7.5 Recap……Page 258
Dialog boxes……Page 260
8.1 Message boxes……Page 261
8.1.2 Creating an OK dialog……Page 263
Result……Page 264
Result……Page 265
8.1.4 Creating A YesNoCancel dialog……Page 266
Result……Page 267
Result……Page 268
8.2.1 The relationship between Close and Dispose……Page 269
8.2.2 Intercepting the Form.Close method……Page 271
Result……Page 272
8.3 Modal dialog boxes……Page 273
Result……Page 274
Result……Page 275
8.3.3 Creating the CaptionDlg form……Page 276
Result……Page 278
Result……Page 279
Result……Page 283
Result……Page 284
Result……Page 285
Result……Page 286
Result……Page 287
8.4 Modeless dialogs……Page 288
Result……Page 289
Result……Page 291
8.4.3 Displaying the modeless PixelDlg form……Page 292
Result……Page 293
Result……Page 294
Result……Page 295
8.4.5 Updating PixelDlg as the mouse moves……Page 296
Result……Page 297
8.5 Recap……Page 298
Basic controls……Page 299
9.1 Form inheritance……Page 300
Result……Page 301
Result……Page 302
Result……Page 304
Result……Page 305
9.2 Labels and text boxes……Page 307
Result……Page 308
Result……Page 310
Result……Page 312
9.2.2 Creating the PhotoEditDlg panel area……Page 313
Result……Page 314
9.2.3 Creating the multiline text box……Page 317
Result……Page 319
Result……Page 320
Result……Page 321
Result……Page 322
9.2.5 Using TextBox controls……Page 323
Result……Page 325
9.3 Button classes……Page 326
Result……Page 329
Result……Page 330
Result……Page 331
Result……Page 332
Result……Page 333
9.3.3 Creating the AlbumEditDlg panel area……Page 334
Result……Page 335
9.3.4 Using radio buttons……Page 336
Result……Page 337
9.3.5 Using check box buttons……Page 340
Result……Page 342
Result……Page 346
Result……Page 348
9.4 Recap……Page 349
List controls……Page 350
10.1.1 Creating a list box……Page 351
Result……Page 353
Result……Page 354
Result……Page 355
10.1.2 Handling selected items……Page 358
Result……Page 360
10.2.1 Enabling multiple selection……Page 361
Result……Page 362
10.2.2 Handling the Move Up and Move Down buttons……Page 364
Result……Page 365
Result……Page 366
10.2.3 Handling the Remove button……Page 367
Result……Page 368
10.3.1 Creating a combo box……Page 369
Result……Page 371
10.3.2 Handling the selected item……Page 372
Result……Page 373
10.4 Combo box edits……Page 375
Result……Page 376
10.4.2 Updating the combo box dynamically……Page 377
Result……Page 378
10.5 Owner-drawn lists……Page 379
10.5.1 Adding a context menu……Page 380
Result……Page 381
10.5.2 Setting the item height……Page 382
Result……Page 383
Result……Page 384
Result……Page 385
10.6 Recap……Page 388
More controls……Page 389
11.1 Tab controls……Page 390
11.1.1 The TabControl class……Page 391
11.1.2 Creating a tab control……Page 392
Result……Page 393
Result……Page 394
11.2 Tab pages……Page 395
Result……Page 396
11.2.2 Creating tab pages in Visual Studio……Page 399
Result……Page 400
11.3 Dates and Times……Page 402
11.3.1 Dates and times……Page 403
Result……Page 404
11.3.2 Customizing a DateTimePicker control……Page 405
Result……Page 407
11.4.1 Adding a MonthCalendar control……Page 408
11.4.2 Initializing a calendar……Page 410
Result……Page 411
11.4.3 Handling mouse clicks in a calendar control……Page 412
Result……Page 413
11.5 Recap……Page 417
A .NET assortment……Page 419
12.1.1 Handling the KeyPress event……Page 420
Result……Page 421
12.1.2 Handling other keyboard events……Page 422
12.2 Mouse events……Page 423
12.2.2 Handling mouse events……Page 424
Result……Page 425
Result……Page 426
Result……Page 427
12.3.1 Implementing Next and Prev buttons……Page 429
Result……Page 430
Result……Page 431
Result……Page 432
Result……Page 433
Result……Page 434
Result……Page 435
Result……Page 436
Result……Page 438
12.4 Icons……Page 441
Result……Page 442
Result……Page 443
Result……Page 444
12.5 Recap……Page 445
Toolbars and tips……Page 446
13.1.1 The ToolBar class……Page 447
13.1.2 Adding a toolbar……Page 448
13.1.3 The ToolBarButton class……Page 449
13.2.1 The ImageList class……Page 452
Result……Page 453
13.3.1 Adding a push button……Page 456
Result……Page 457
Result……Page 458
Result……Page 459
Result……Page 460
13.3.3 Adding a toggle button……Page 462
Result……Page 464
Result……Page 465
13.4 Tool tips……Page 466
13.4.2 Creating tool tips……Page 467
Result……Page 468
Result……Page 469
13.5 Recap……Page 470
Advanced Windows Forms……Page 473
List views……Page 475
14.1 The nature of list views……Page 476
14.2.1 Creating the MyAlbumExplorer project……Page 479
Result……Page 480
Result……Page 481
Result……Page 483
14.2.3 Populating a ListView……Page 484
Result……Page 486
Action……Page 487
14.3 ListView columns……Page 489
14.3.1 Creating the columns……Page 490
Result……Page 491
14.3.2 Populating the columns……Page 492
14.3.3 Sorting a column……Page 494
Result……Page 496
Result……Page 498
14.4.1 Supporting item selection……Page 500
Result……Page 501
14.4.2 Supporting label edits……Page 504
Result……Page 505
Result……Page 506
14.5 Item activation……Page 508
Result……Page 509
Result……Page 510
Result……Page 511
14.5.3 Populating the ListView……Page 512
14.5.4 Sorting a column (again)……Page 513
Result……Page 514
Result……Page 515
Result……Page 516
Result……Page 517
Result……Page 518
14.6 Recap……Page 519
Tree views……Page 521
15.2 The TreeView class……Page 522
Result……Page 524
15.2.2 Using the Splitter class……Page 525
Result……Page 526
15.2.3 Using the TreeNode class……Page 528
Result……Page 530
15.3.1 Assigning index constants……Page 533
15.3.2 Creating the album nodes……Page 534
Result……Page 535
Result……Page 536
15.3.3 Creating the photograph nodes……Page 537
Result……Page 539
15.4 Node selection……Page 541
15.4.1 Supporting node selection……Page 542
Result……Page 543
Result……Page 544
15.4.2 Revisiting the list view……Page 545
Result……Page 546
Result……Page 548
15.5 Fun with tree views……Page 549
Result……Page 550
15.5.2 Supporting label edits……Page 552
Result……Page 553
15.5.3 Updating the properties menu……Page 556
Result……Page 557
15.6 Recap……Page 560
Multiple document interfaces……Page 561
16.1.2 Explorer interfaces……Page 562
16.1.3 Multiple document interfaces……Page 563
16.1.4 Support in Windows Forms……Page 565
16.2 MDI forms……Page 566
Result……Page 567
Result……Page 568
16.2.3 Adding a new entry point……Page 569
Result……Page 570
16.3.1 Assigning merge types……Page 571
Result……Page 572
16.3.2 Assigning merge order……Page 573
Result……Page 575
Result……Page 576
16.3.3 Opening a child form……Page 577
Result……Page 578
16.4.1 Replacing the toolbar……Page 579
Result……Page 580
Result……Page 581
Result……Page 582
16.4.2 Displaying pixel data……Page 584
Result……Page 585
Result……Page 586
16.4.3 Opening an album twice……Page 587
Result……Page 588
16.4.4 Updating the title bar……Page 589
Result……Page 590
Result……Page 592
16.5 MDI child window management……Page 593
16.5.1 Arranging MDI forms……Page 594
Result……Page 596
16.5.2 Creating an MDI child list……Page 597
Result……Page 598
16.6 Recap……Page 599
Data binding……Page 600
17.1 Data grids……Page 601
Result……Page 604
Result……Page 605
17.2 Data grid customization……Page 609
17.2.1 Customizing table styles……Page 610
Result……Page 611
17.2.2 Customizing column styles……Page 612
Result……Page 614
17.3.1 The IEditableObject interface……Page 616
17.3.2 Supporting the IEditableObject interface……Page 618
Result……Page 619
17.3.3 Using editable objects……Page 620
Result……Page 621
17.4 Simple data binding……Page 622
17.4.1 Altering the MyAlbumData application……Page 623
Result……Page 624
17.4.2 Performing simple binding……Page 626
Result……Page 629
17.4.3 Updating data bound controls……Page 630
Result……Page 632
Result……Page 633
Result……Page 635
Result……Page 637
17.5 Recap……Page 638
Odds and ends .NET……Page 639
18.1 Printing……Page 640
Result……Page 641
Result……Page 642
Result……Page 643
Result……Page 645
18.2 Timers……Page 647
18.2.1 Creating a slide show form……Page 648
Result……Page 649
Result……Page 651
18.3 Drag and drop……Page 654
Result……Page 656
18.3.2 Receiving drag and drop……Page 658
Result……Page 659
18.4 ActiveX controls……Page 661
18.4.1 Creating the About box……Page 662
Result……Page 663
18.4.2 Wrapping the web browser control……Page 665
Result……Page 666
Result……Page 667
Result……Page 668
18.5 Recap……Page 671
C# primer……Page 673
A.1.2 Namespaces……Page 674
A.2 Types……Page 675
A.2.1 Classes……Page 676
A.2.2 Structures……Page 686
A.2.3 Interfaces……Page 687
A.2.4 Enumerations……Page 688
A.2.5 Delegates……Page 689
A.3.1 Built-in types……Page 690
A.3.2 Operators……Page 691
A.3.3 Keywords……Page 692
A.4 Special features……Page 703
A.4.1 Exceptions……Page 704
A.4.2 Arrays……Page 706
A.4.4 Boxing……Page 707
A.4.5 Documentation……Page 708
.NET namespaces……Page 710
B.4 System.Drawing……Page 711
B.7 System.Net……Page 712
B.9 System.Resources……Page 713
B.11 System.Threading……Page 714
B.14 System.XML……Page 715
Visual index……Page 716
C.1 Objects……Page 718
C.2 Marshal by reference objects……Page 719
C.3 Components……Page 720
C.4 Common dialogs……Page 721
C.5 Controls (part 1)……Page 722
C.6 Controls (part 2)……Page 723
C.8 Enumerations……Page 724
For more information……Page 726
Bibliography……Page 728
A……Page 731
B……Page 732
C……Page 733
D……Page 736
E……Page 737
F……Page 738
H……Page 739
I……Page 740
L……Page 741
M……Page 742
N……Page 743
P……Page 744
S……Page 746
T……Page 749
V……Page 750
Z……Page 751
Inside back cover……Page 755

Reviews

There are no reviews yet.

Be the first to review “Windows Forms Programming with C#”
Shopping Cart
Scroll to Top