وبلاگ بلیان

Windows Forms Programming with C#

معرفی کتاب «Windows Forms Programming with C#» نوشتهٔ Erik E. Brown، منتشرشده توسط نشر Manning Publications Co. LLC در سال 2002. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Windows Forms Programming with C#» در دستهٔ بدون دسته‌بندی قرار دارد.

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. Inside front cover......Page 1 Part 3 Advanced Windows Forms437......Page 8 contents......Page 10 preface......Page 18 The Windows Forms namespace......Page 20 Part 2: Basic Windows Forms......Page 21 Part 3: Advanced Windows Forms......Page 22 Who should read this book?......Page 23 Result......Page 24 Author online......Page 26 acknowledgments......Page 27 about .NET......Page 29 Casting the .NET......Page 30 Windows Forms overview......Page 31 about the cover illustration......Page 33 Hello Windows Forms......Page 36 Getting started with Windows Forms......Page 38 1.1 Programming in C#......Page 39 1.1.1 Namespaces and classes......Page 41 1.1.2 Constructors and methods......Page 43 1.1.3 C# types......Page 44 1.1.5 The Application class......Page 46 1.2 Adding controls......Page 48 1.2.1 Shortcuts and fully qualified names......Page 50 1.2.2 Fields and properties......Page 51 1.3 Loading files......Page 53 1.3.1 Events......Page 55 1.3.2 The OpenFileDialog class......Page 57 1.3.3 Bitmap images......Page 59 1.4 Resizing forms......Page 61 1.4.1 Desktop layout properties......Page 63 1.4.2 The Anchor property......Page 64 1.4.3 The Dock property......Page 66 1.5 Recap......Page 68 Getting started with Visual Studio .NET......Page 69 2.1 Programming with Visual Studio .NET......Page 70 2.1.1 Creating a project......Page 71 Result......Page 72 2.1.3 Viewing the source code......Page 74 Result......Page 75 2.2.1 The AssemblyInfo file......Page 78 Results......Page 80 2.2.2 Renaming a form......Page 81 Result......Page 82 2.2.3 The Toolbox window......Page 83 Result......Page 85 2.3.1 Event handlers in Visual Studio .NET......Page 89 Result......Page 90 2.3.2 Exception handling......Page 93 Result......Page 95 2.4 Resizing forms......Page 96 Result......Page 98 Result......Page 99 2.5 Recap......Page 100 Basic Windows Forms......Page 102 Menus......Page 104 3.1 The nature of menus......Page 105 3.1.2 The Menu class hierarchy......Page 106 3.1.3 Derived classes......Page 108 3.2.1 Adding the Main menu......Page 109 Result......Page 110 Result......Page 112 3.2.3 Adding the dropdown menu......Page 114 Result......Page 118 Result......Page 119 Result......Page 120 3.3.2 Adding handlers via the properties window......Page 121 Result......Page 122 3.4 Popup events and shared handlers......Page 123 Result......Page 124 Result......Page 126 Result......Page 127 3.4.2 Handling Popup events......Page 128 Result......Page 129 3.5 Context menus......Page 132 Result......Page 133 Result......Page 135 3.6 Recap......Page 136 Status bars......Page 137 4.1 The Control class......Page 138 4.2 The StatusBar class......Page 140 Result......Page 141 Result......Page 144 4.3 Status bar panels......Page 145 Result......Page 146 Result......Page 151 4.4.1 The DrawItem event......Page 153 Result......Page 156 4.5 Recap......Page 160 Reusable libraries......Page 161 5.1 C# classes and interfaces......Page 162 5.1.1 Interfaces......Page 163 5.1.2 Data collection classes......Page 164 5.2 Class libraries......Page 168 Result......Page 169 Result......Page 171 Result......Page 172 5.2.2 Using the command-line tools......Page 173 5.2.3 Creating the PhotoAlbum class......Page 174 Result......Page 175 Result......Page 176 Result......Page 177 Result......Page 179 5.3 Interfaces revisited......Page 180 5.3.2 Supporting the IList interface......Page 181 Result......Page 182 5.3.3 Implementing album position operations......Page 183 Result......Page 184 Result......Page 185 5.4.1 Handling an invalid bitmap......Page 186 Result......Page 187 5.4.2 Overriding methods in the Object class......Page 189 Result......Page 190 5.4.3 Disposing of resources......Page 192 Result......Page 193 Result......Page 194 5.5 Recap......Page 195 Common file dialogs......Page 196 6.1.1 Changing the menu bar......Page 197 Results......Page 198 Result......Page 199 Result......Page 200 6.2.1 Adding images to an album......Page 201 Result......Page 202 6.3 Paint events......Page 204 6.3.1 Drawing the current photograph......Page 205 6.3.2 Displaying the current position......Page 206 Result......Page 207 6.4 Context menus revisited......Page 208 6.4.2 Displaying the previous photograph......Page 209 6.5.1 Creating a default album directory......Page 210 Result......Page 212 Result......Page 214 6.5.3 Handling the New menu......Page 215 6.6 Save file dialogs......Page 216 6.6.1 Writing album data......Page 217 Result......Page 218 Result......Page 219 6.6.2 Saving an album as a new file......Page 221 6.6.3 Saving an existing album......Page 223 6.7 Open file dialogs......Page 224 Result......Page 225 6.7.2 Opening an album file......Page 226 Result......Page 227 6.8 Recap......Page 228 Drawing and scrolling......Page 229 7.1 Form class hierarchy......Page 230 7.1.2 The Form class......Page 231 7.2.1 Deleting the PictureBox control......Page 233 Result......Page 234 7.2.3 Implementing the Stretch to Fit option......Page 237 Result......Page 238 7.2.4 Implementing a Scale to Fit option......Page 240 Result......Page 242 Result......Page 243 Result......Page 244 7.2.5 Repainting when the form is resized......Page 245 Result......Page 246 7.3 Automated scrolling......Page 247 7.3.2 Implementing automated scrolling......Page 248 Result......Page 249 7.4 Panels......Page 250 Result......Page 252 Result......Page 253 Result......Page 254 Result......Page 255 Result......Page 256 7.5 Recap......Page 257 Dialog boxes......Page 259 8.1 Message boxes......Page 260 8.1.2 Creating an OK dialog......Page 262 Result......Page 263 Result......Page 264 8.1.4 Creating A YesNoCancel dialog......Page 265 Result......Page 266 Result......Page 267 8.2.1 The relationship between Close and Dispose......Page 268 8.2.2 Intercepting the Form.Close method......Page 270 Result......Page 271 8.3 Modal dialog boxes......Page 272 Result......Page 273 Result......Page 274 8.3.3 Creating the CaptionDlg form......Page 275 Result......Page 277 Result......Page 278 Result......Page 282 Result......Page 283 Result......Page 284 Result......Page 285 Result......Page 286 8.4 Modeless dialogs......Page 287 Result......Page 288 Result......Page 290 8.4.3 Displaying the modeless PixelDlg form......Page 291 Result......Page 292 Result......Page 293 Result......Page 294 8.4.5 Updating PixelDlg as the mouse moves......Page 295 Result......Page 296 8.5 Recap......Page 297 Basic controls......Page 298 9.1 Form inheritance......Page 299 Result......Page 300 Result......Page 301 Result......Page 303 Result......Page 304 9.2 Labels and text boxes......Page 306 Result......Page 307 Result......Page 309 Result......Page 311 9.2.2 Creating the PhotoEditDlg panel area......Page 312 Result......Page 313 9.2.3 Creating the multiline text box......Page 316 Result......Page 318 Result......Page 319 Result......Page 320 Result......Page 321 9.2.5 Using TextBox controls......Page 322 Result......Page 324 9.3 Button classes......Page 325 Result......Page 328 Result......Page 329 Result......Page 330 Result......Page 331 Result......Page 332 9.3.3 Creating the AlbumEditDlg panel area......Page 333 Result......Page 334 9.3.4 Using radio buttons......Page 335 Result......Page 336 9.3.5 Using check box buttons......Page 339 Result......Page 341 Result......Page 345 Result......Page 347 9.4 Recap......Page 348 List controls......Page 349 10.1.1 Creating a list box......Page 350 Result......Page 352 Result......Page 353 Result......Page 354 10.1.2 Handling selected items......Page 357 Result......Page 359 10.2.1 Enabling multiple selection......Page 360 Result......Page 361 10.2.2 Handling the Move Up and Move Down buttons......Page 363 Result......Page 364 Result......Page 365 10.2.3 Handling the Remove button......Page 366 Result......Page 367 10.3.1 Creating a combo box......Page 368 Result......Page 370 10.3.2 Handling the selected item......Page 371 Result......Page 372 10.4 Combo box edits......Page 374 Result......Page 375 10.4.2 Updating the combo box dynamically......Page 376 Result......Page 377 10.5 Owner-drawn lists......Page 378 10.5.1 Adding a context menu......Page 379 Result......Page 380 10.5.2 Setting the item height......Page 381 Result......Page 382 Result......Page 383 Result......Page 384 10.6 Recap......Page 387 More controls......Page 388 11.1 Tab controls......Page 389 11.1.1 The TabControl class......Page 390 11.1.2 Creating a tab control......Page 391 Result......Page 392 Result......Page 393 11.2 Tab pages......Page 394 Result......Page 395 11.2.2 Creating tab pages in Visual Studio......Page 398 Result......Page 399 11.3 Dates and Times......Page 401 11.3.1 Dates and times......Page 402 Result......Page 403 11.3.2 Customizing a DateTimePicker control......Page 404 Result......Page 406 11.4.1 Adding a MonthCalendar control......Page 407 11.4.2 Initializing a calendar......Page 409 Result......Page 410 11.4.3 Handling mouse clicks in a calendar control......Page 411 Result......Page 412 11.5 Recap......Page 416 A .NET assortment......Page 418 12.1.1 Handling the KeyPress event......Page 419 Result......Page 420 12.1.2 Handling other keyboard events......Page 421 12.2 Mouse events......Page 422 12.2.2 Handling mouse events......Page 423 Result......Page 424 Result......Page 425 Result......Page 426 12.3.1 Implementing Next and Prev buttons......Page 428 Result......Page 429 Result......Page 430 Result......Page 431 Result......Page 432 Result......Page 433 Result......Page 434 Result......Page 435 Result......Page 437 12.4 Icons......Page 440 Result......Page 441 Result......Page 442 Result......Page 443 12.5 Recap......Page 444 Toolbars and tips......Page 445 13.1.1 The ToolBar class......Page 446 13.1.2 Adding a toolbar......Page 447 13.1.3 The ToolBarButton class......Page 448 13.2.1 The ImageList class......Page 451 Result......Page 452 13.3.1 Adding a push button......Page 455 Result......Page 456 Result......Page 457 Result......Page 458 Result......Page 459 13.3.3 Adding a toggle button......Page 461 Result......Page 463 Result......Page 464 13.4 Tool tips......Page 465 13.4.2 Creating tool tips......Page 466 Result......Page 467 Result......Page 468 13.5 Recap......Page 469 Advanced Windows Forms......Page 472 List views......Page 474 14.1 The nature of list views......Page 475 14.2.1 Creating the MyAlbumExplorer project......Page 478 Result......Page 479 Result......Page 480 Result......Page 482 14.2.3 Populating a ListView......Page 483 Result......Page 485 Action......Page 486 14.3 ListView columns......Page 488 14.3.1 Creating the columns......Page 489 Result......Page 490 14.3.2 Populating the columns......Page 491 14.3.3 Sorting a column......Page 493 Result......Page 495 Result......Page 497 14.4.1 Supporting item selection......Page 499 Result......Page 500 14.4.2 Supporting label edits......Page 503 Result......Page 504 Result......Page 505 14.5 Item activation......Page 507 Result......Page 508 Result......Page 509 Result......Page 510 14.5.3 Populating the ListView......Page 511 14.5.4 Sorting a column (again)......Page 512 Result......Page 513 Result......Page 514 Result......Page 515 Result......Page 516 Result......Page 517 14.6 Recap......Page 518 Tree views......Page 520 15.2 The TreeView class......Page 521 Result......Page 523 15.2.2 Using the Splitter class......Page 524 Result......Page 525 15.2.3 Using the TreeNode class......Page 527 Result......Page 529 15.3.1 Assigning index constants......Page 532 15.3.2 Creating the album nodes......Page 533 Result......Page 534 Result......Page 535 15.3.3 Creating the photograph nodes......Page 536 Result......Page 538 15.4 Node selection......Page 540 15.4.1 Supporting node selection......Page 541 Result......Page 542 Result......Page 543 15.4.2 Revisiting the list view......Page 544 Result......Page 545 Result......Page 547 15.5 Fun with tree views......Page 548 Result......Page 549 15.5.2 Supporting label edits......Page 551 Result......Page 552 15.5.3 Updating the properties menu......Page 555 Result......Page 556 15.6 Recap......Page 559 Multiple document interfaces......Page 560 16.1.2 Explorer interfaces......Page 561 16.1.3 Multiple document interfaces......Page 562 16.1.4 Support in Windows Forms......Page 564 16.2 MDI forms......Page 565 Result......Page 566 Result......Page 567 16.2.3 Adding a new entry point......Page 568 Result......Page 569 16.3.1 Assigning merge types......Page 570 Result......Page 571 16.3.2 Assigning merge order......Page 572 Result......Page 574 Result......Page 575 16.3.3 Opening a child form......Page 576 Result......Page 577 16.4.1 Replacing the toolbar......Page 578 Result......Page 579 Result......Page 580 Result......Page 581 16.4.2 Displaying pixel data......Page 583 Result......Page 584 Result......Page 585 16.4.3 Opening an album twice......Page 586 Result......Page 587 16.4.4 Updating the title bar......Page 588 Result......Page 589 Result......Page 591 16.5 MDI child window management......Page 592 16.5.1 Arranging MDI forms......Page 593 Result......Page 595 16.5.2 Creating an MDI child list......Page 596 Result......Page 597 16.6 Recap......Page 598 Data binding......Page 599 17.1 Data grids......Page 600 Result......Page 603 Result......Page 604 17.2 Data grid customization......Page 608 17.2.1 Customizing table styles......Page 609 Result......Page 610 17.2.2 Customizing column styles......Page 611 Result......Page 613 17.3.1 The IEditableObject interface......Page 615 17.3.2 Supporting the IEditableObject interface......Page 617 Result......Page 618 17.3.3 Using editable objects......Page 619 Result......Page 620 17.4 Simple data binding......Page 621 17.4.1 Altering the MyAlbumData application......Page 622 Result......Page 623 17.4.2 Performing simple binding......Page 625 Result......Page 628 17.4.3 Updating data bound controls......Page 629 Result......Page 631 Result......Page 632 Result......Page 634 Result......Page 636 17.5 Recap......Page 637 Odds and ends .NET......Page 638 18.1 Printing......Page 639 Result......Page 640 Result......Page 641 Result......Page 642 Result......Page 644 18.2 Timers......Page 646 18.2.1 Creating a slide show form......Page 647 Result......Page 648 Result......Page 650 18.3 Drag and drop......Page 653 Result......Page 655 18.3.2 Receiving drag and drop......Page 657 Result......Page 658 18.4 ActiveX controls......Page 660 18.4.1 Creating the About box......Page 661 Result......Page 662 18.4.2 Wrapping the web browser control......Page 664 Result......Page 665 Result......Page 666 Result......Page 667 18.5 Recap......Page 670 C# primer......Page 672 A.1.2 Namespaces......Page 673 A.2 Types......Page 674 A.2.1 Classes......Page 675 A.2.2 Structures......Page 685 A.2.3 Interfaces......Page 686 A.2.4 Enumerations......Page 687 A.2.5 Delegates......Page 688 A.3.1 Built-in types......Page 689 A.3.2 Operators......Page 690 A.3.3 Keywords......Page 691 A.4 Special features......Page 702 A.4.1 Exceptions......Page 703 A.4.2 Arrays......Page 705 A.4.4 Boxing......Page 706 A.4.5 Documentation......Page 707 .NET namespaces......Page 709 B.4 System.Drawing......Page 710 B.7 System.Net......Page 711 B.9 System.Resources......Page 712 B.11 System.Threading......Page 713 B.14 System.XML......Page 714 Visual index......Page 715 C.1 Objects......Page 717 C.2 Marshal by reference objects......Page 718 C.3 Components......Page 719 C.4 Common dialogs......Page 720 C.5 Controls (part 1)......Page 721 C.6 Controls (part 2)......Page 722 C.8 Enumerations......Page 723 For more information......Page 725 Bibliography......Page 727 A......Page 730 B......Page 731 C......Page 732 D......Page 735 E......Page 736 F......Page 737 H......Page 738 I......Page 739 L......Page 740 M......Page 741 N......Page 742 P......Page 743 S......Page 745 T......Page 748 V......Page 749 Z......Page 750 Inside back cover......Page 754

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. As a way to demonstrate how Windows Forms applications are constructed, the book provides a chapter-by-chapter guide to building an image application to view, share, and manage digital photos stored on a hard drive or on removable media. Also discussed are Visual Studio 7.0, C# language syntax and usage, Windows Forms controls, ADO.NET, and other topics vital to the creation and deployment of Windows applications in this new environment.

p, li { white-space: pre-wrap; } This is a decent step-by-step book for programming using Windows forms in C#. The entire book is well written in a tutorial format. Plenty of examples present key how-to-use features of the Windows forms. It's an excellent entry level book for GUI programming with C#. However, as some reviews mentioned, the details on some specific topics, such as progress status bar and the multi-threading, are missing. Buyers/Readers be aware: this book is a bit out of date. The examples in the contents are different from you will find in Visual Studio 2005 or later. Describes the Windows Forms namespace and its role in developing Windows applications within the .NET Framework, and illustrates how to perform tasks including creating menus and text boxes.
دانلود کتاب Windows Forms Programming with C#