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.
“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
- Paths, regions, and clipping
- Dialog boxes
- Brushes and pens
- Edit, list, and spin controls
- Font fun
- Toolbars and status bars
- Tree view and List view
- Clip, drag, and drop
INCLUDED ON CD-ROM:* Sample source code for all the examples presented in the book
A Note Regarding the CD or DVD
The print version of this book ships with a CD or DVD. For those customers purchasing one of the digital formats in which this book is available, we are pleased to offer the CD/DVD content as a free download via O'Reilly Media's Digital Distribution services. To download this content, please visit O'Reilly's web site, search for the title of this book to find its catalog page, and click on the link below the cover image (Examples, Companion Content, or Practice Files). Note that while we provide as much of the media content as we are able via free download, we are sometimes limited by licensing restrictions.