Aimed at aspiring C# programmers of all levels, legendary Windows expert Charles Petzold's Programming Windows with C# provides an extremely in-depth and intelligent tutorial to the APIs underpinning Microsoft's .NET Framework.
For a generation of programmers, Petzold's Programming Windows: The Definitive Guide to the Win32 API provided a virtual bible on how to get started with Windows development. This massive, handsomely bound hardcover edition attempts the same breadth of coverage for Microsoft's new C# language and the new .NET. With several examples clearly inspired by the earlier C title, this book demonstrates the author's keen eye for showing off and explaining the capabilities of low-level APIs to good effect.
The book first outlines basic "Hello World" examples for both a console and Windows Forms. Next, there's coverage of basic support classes (like points and rectangles) before turning toward using these structures in extensive sections on graphics programming. Petzold's traditional strengths as a computer author are in ample evidence here, with many short examples that exercise the capabilities of the new .NET APIs.
Veteran readers will recognize the basic shape of the early Win32 title in the organization of this (completely rewritten) C# version in the flow of topics from graphics, keyboard, mouse and timers, and the like. (One production note here is that the order of later chapters does jump around somewhat, circling back to graphics topics several times instead of presenting related APIs in order.)
The sections on graphics transforms and how to manipulate images are worthy of note. There's excellent coverage of the possibilities of working with text and fonts output in .NET. Nifty working samples for several types of clocks and shape-drawing demos will let you explore graphical APIs in detail.
Several chapters cover basic Windows Forms control programming with buttons, labels, and edit controls and then splitters, ListView, and TreeView controls. This volume closes out with references to files and streams, and math and string APIs. For any developer who wants to create state-of-the-art, "traditional" client-side software, this book is sure to be required reading for its in-depth look at graphics and other leading-edge .NET features. It proves once again that learning low-level APIs in detail is still a good way to learn Windows programming. --Richard Dragan
Topics covered: Overview of C# and .NET Windows programming fundamentals; a "Hello World" console application; C# language and object basics; a simple Windows Forms application (creating a main window and handling the paint events); basic .NET structures (including rectangles, points, and colors); text output and scrolling; exploring .NET system information; in-depth tutorial for GDI+ programming: pens, lines, rectangles, and polygons; keyboard processing (plus a custom class for caret processing); graphics transformations (including scaling, linear transforms with matrices); mouse processing (plus processing the mouse wheel); text and fonts (TrueType and OpenType fonts, antialiasing, measuring text); using timers; date and time APIs; a sample code for clocks; drawing and transforming images (displaying JPG and BMP files); simple animation; basic control programming (buttons, labels, scroll bars, and track bars); exploring Bezier curves and splines; menus (basic and custom); graphics paths and regions; clipping techniques; basic dialog box programming (modal and modeless forms); edit, list, and spin controls; font transforms and special effects, using toolbars and status bars, printing techniques (including print dialogs), splitter, TreeView, and ListView controls; programming with the clipboard, drag-and-drop support, reference sections on APIs for programming with files and streams, math functions, and strings.
Book Description
This core reference provides the expert guidance that professional developers need to build applications with Windows Forms-the next-generation Microsoft Windows programming class library. Best-selling author on programming for the Windows operating system Charles Petzold shows readers how to use Microsoft Visual C#-the advanced, object-oriented language for the Microsoft .NET platform-to create dynamic user interfaces and graphical outputs for distributed or stand-alone applications. Numerous application examples-with reusable code on companion CD-ROM-help developers increase their productivity.
Programming Windows with C# (Core Reference) FROM OUR EDITORS
The Barnes & Noble Review
C# and .NET were made for each other. So, it seems, were Windows and Charles Petzold. Petzold's Programming Windows, first published in 1988 and now in its fifth edition, has been the most authoritative guide to Windows development for one generation of programmers after another. Now, it's joined by a new classic: his new Programming Microsoft Windows with C#.
Web apps get the hype nowadays; Petzold focuses elsewhere: on the powerful .NET Windows Forms tools that enable state-of-the-art Windows development. Whether you're building traditional standalone "client" apps or front-ends for distributed systems, he guides you through the "Windows" side of .NET with unprecedented depth and insight.
This isn't "Harry Potter" coding: No wizards allowed. Petzold doesn't even use the Windows Forms Designer: It can take you only so far, he says, and if you don't understand how to manually code your controls, you'll be up a creek without a paddle. Prepare to get your hands dirty.
Petzold begins with the basics of Windows Forms, the essential data types required to program graphical applications, and the basics of text output. Then, he moves on to the two large collections of .NET framework classes -- user and graphics -- that encompass the "visual" aspects of Windows development. While these can be traced all the way back to Windows 1.0, they've been refined again -- and, of course, C# and .NET change how you get at them.
On the "graphics" side of the house, the book's systematic coverage includes lines, curves, fills, pages, transforms, text, fonts, images, bitmaps, Bᄑzier curves, paths, regions, clipping, brushes, pens, fonts, printing, and vector graphic metafiles. On the UI side, he starts with mouse and keyboard programming (showing how to provide the oft-neglected keyboard equivalents, and raising a few thorny issues that seem to require recourse to the old Win32 API). Next, he covers all the GUI elements of a modern Windows application: buttons, labels, scrolling, dialog boxes, edit, list, and spin boxes, toolbars, status bars, tree views, list views, clipboards, and more.
One more note: Whether you're writing Windows or web apps, you'll often find yourself dealing with file I/O, floating-point mathematics, and string manipulation. Each are significantly changed in the C#/.NET environment. Failing to find reliable guides to them, Petzold has written his own and included them as appendices.
As Windows programming continues to evolve, one thing fortunately remains constant: Charles Petzold's still there to explain it to us -- brilliantly.
(Bill Camarda)
Bill Camarda is a consultant, writer, and web/multimedia content developer with nearly 20 years' experience in helping technology companies deploy and market advanced software, computing, and networking products and services. He served for nearly ten years as vice president of a New Jerseybased marketing company, where he supervised a wide range of graphics and web design projects. His 15 books include Special Edition Using Word 2000 and Upgrading & Fixing Networks For Dummies®, Second Edition.
FROM THE PUBLISHER
Get the expert guidance you need to take full advantage of Microsoft .NET with Windows Forms.
"Look it up in Petzold" remains the last word on Windows development. In this .NET-ready Windows programming guide, the best-selling author shows you how to get the most out of Windows Formsᄑthe next-generation Windows programming class library. You'll discover how to use C# to create dynamic user interfaces and graphical outputs for Windows applications. With dozens of examples of client applications to illustrate common techniques and plenty of no-nonsense advice on best programming practices, you'll be C# sharp in no time.
Topics covered in this guide include:
A tour of C#
Windows Forms
Essential structures
An exercise in text output
Lines, curves, and area fills
Tapping into the keyboard
Pages and transforms
Taming the mouse
Text and fonts
The timer and time
Images and bitmaps
Buttons, labels, and scrolls
Bᄑziers and other splines
Menus
Paths, regions, and clipping
Dialog boxes
Brushes and pens
Edit, list, and spin controls
Font fun
Toolbars and status bars
Printing
Tree view and List view
Metafiles
Clip, drag, and drop
Included on CD-ROM:
Sample source code for all the examples presented in the book
SYNOPSIS
This core reference delivers essential guidance for anyone who uses the Microsoft Visual C# development system to produce stand-alone Microsoft Windows-based and Web-enabled Microsoft .NET applications.