Programming Microsoft® Windows® with C# and over one million other books are available for Amazon Kindle. Learn more

Kindle Edition
 
   
Have one to sell? Sell yours here
Programming Microsoft   Windows  with C#
 
 
Start reading Programming Microsoft® Windows® with C# on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Programming Microsoft Windows with C# [Paperback]

Charles Petzold (Author)
4.1 out of 5 stars  See all reviews (73 customer reviews)


Available from these sellers.


Formats

Amazon Price New from Used from
Kindle Edition $38.39  
Paperback --  

Book Description

Microsoft January 18, 2002

“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

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. Please direct any questions or concerns to booktech@oreilly.com.



Editorial Reviews

Amazon.com Review

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.

About the Author

Charles Petzold wrote the classic Programming Windows®, which is currently in its fifth edition and one of the best-known and widely used programming books of all time. He was honored in 1994 with the Windows Pioneer Award, presented by Microsoft® founder Bill Gates and Windows Magazine. He has been programming with Windows since first obtaining a beta Windows 1.0 SDK in the spring of 1985, and he wrote the very first magazine article on Windows programming in 1986. Charles is an MVP for Client Application Development and the author of several other books including Code: The Hidden Language of Computer Hardware and Software.


Product Details

  • Paperback: 1290 pages
  • Publisher: Microsoft Press (January 18, 2002)
  • Language: English
  • ISBN-10: 0735613702
  • ISBN-13: 978-0735613706
  • Product Dimensions: 9.4 x 7.7 x 2.4 inches
  • Shipping Weight: 4.8 pounds
  • Average Customer Review: 4.1 out of 5 stars  See all reviews (73 customer reviews)
  • Amazon Best Sellers Rank: #682,966 in Books (See Top 100 in Books)

More About the Author

Discover books, learn about writers, read author blogs, and more.

 

Customer Reviews

73 Reviews
5 star:
 (44)
4 star:
 (10)
3 star:
 (5)
2 star:
 (9)
1 star:
 (5)
 
 
 
 
 
Average Customer Review
4.1 out of 5 stars (73 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

96 of 99 people found the following review helpful:
5.0 out of 5 stars Be better called Programming Windows GUI with C# :), January 11, 2002
This review is from: Programming Microsoft Windows with C# (Paperback)
This book is for neither .NET/C# programming language nor Windows Operating System. It focuses on Windows GUI programming.
It only spends about 40 pages on C# language basics, and also, it never mentions COM/COM+, which are very important features for Windows platform.
This is the best reference book for windows forms and .Net GDI+ programming. It spends 1200+ pages to introduce all those Graphic and UI stuff in a C# way. If you are a UI programmer, this book is nothing but a must buy! It includes everything you need to know about .NET/C# GUI programming.
But, if what you are looking for is some C# language reference, please refer to C# Primer: A Practical Approach by Stanley B. Lippman or Progamming C#. If what you want is a detail look into .NET platform/CLR, refer to Compiling for the .NET Common Language Runtime.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


68 of 70 people found the following review helpful:
5.0 out of 5 stars Destined to become a classic, January 25, 2002
By 
Frank Paris (Beaverton, OR USA) - See all my reviews
(REAL NAME)   
Amazon Verified Purchase(What's this?)
This review is from: Programming Microsoft Windows with C# (Paperback)
This is one of the most carefully constructed books on programming that I've ever read. The book builds a doggedly focused exposition of .NET Windows Forms from the ground up, and within that subject, there is very little missing here. Further, any diversions are relegated to three superbly organized appendices on Files and Streams, math functions, and string handling, three areas which rich client windows programmers have to have good mastery of anyhow. When I say that Petzold builds his subject from the ground up, I mean that the book can and should be read like "War and Peace, " from beginning to end without skipping anything. Even if you think you understand the basics, I'd be very surprised if you didn't gain important insights you might have missed before, even from the early and elementary chapters. Virtually nothing is presupposed and your knowledge is build up, block by block. After studying this book, you will understand exactly what is happening in a .NET Windows Forms application. Other books take a shotgun approach, throwing stuff at you that may work, but without providing the background to understand what is happening beneath the sheets. Petzold does not let Visual C# generate code automatically. Visual Studio provides a lot of visual tools and wizards for quickly designing dialog box layouts and generating code frameworks, but Petzold wants you to understand what is really going on, so everything is hand-coded in this book. This can either be a warning to you, or an invitation to those who want a deep understanding of how a Windows Form is really put together. I'd say, do it Petzold's way first, and after you've mastered the foundations of Windows Forms, use the visual tools to save time when your now superior perspective can do so without running the risk of not understanding something the visual tools did that isn't quite working right and you don't have the depth of understanding to quickly zero in on the cause.

There is virtually nothing in this book that is not focused on .NET Windows Forms using C#. Mercifully, VB.NET isn't even mentioned. Also, you won't find diversionary chapters on ADO.NET or ASP.NET. The book treats Windows Forms basics (from the classic "Hello, World", through essential data structures and basic text output), and then alternates the chapters between topics on graphics (GDI+) and user interface elements (mouse, keyboard, timers, buttons, menus, toolbars, etc.). GDI+ is an enhancement to the old GDI and the book contains uncompromising chapters on such graphical topics as Bezier curves and other splines, including all the necessary mathematical background. In the chapter on Pages and Transforms, he presents* all the mathematical background necessary to perform the linear transformations needed to utilize the GDI+ graphical transforms. This is what I mean about uncompromising. He doesn't avoid topics in the .NET Windows Forms classes because they might require a little college algebra that most of us have probably forgotten. He just dives right in and presents everything necessary to come to grips with the deepest .NET classes in Windows Forms. About the only subject he doesn't treat is Image Color Management, a topic so vast it really deserves a book of its own (although "Windows 2000 Graphics API Black Book" has an excellent chapter on the Win32 API).

With such an exhaustive treatment of his subject matter, you might think this book might be pretty dry reading. Not true. Petzold writes with supreme confidence and wry wit, never cloying, always with just the right touch. This book is fun reading, his enthusiasm for his subject matter always in evidence, even when he's exhaustively presenting the methods of a class or an enumeration. You can tell he is having a ball.

There are lots of tables and code in the book. The code is available on an included CD. A minor problem I had is that sometimes the Beta 2 produced a bunch of "System.Byte not defined in the workspace" errors. If this happens to you, just choose Yes when it asks if you want to go ahead anyhow. The applications still work.

His examples are short and are easily typed in by hand, something Petzold recommends anyhow. The way I worked with this book was to embellish little programs of my own anyhow, trying out the facilities he was expositing within my own framework. I probably learned even more taking this approach rather than using his examples literally.

So overall, it is hard to imagine that this book could ever be surpassed. This book deservers an extra rosette, beyond the five stars for those extremely rare computer books that are destined to become a classic teaching a whole generation of programmers.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


39 of 40 people found the following review helpful:
4.0 out of 5 stars Excellent but a Misleading Title, June 15, 2002
This review is from: Programming Microsoft Windows with C# (Paperback)
Programming Microsoft Windows with C#: A Core Reference
As expected, book is an excellent work but title is misleading. I've read the entire book and this is what I found:
1. Excellent book for beginners to write Windows programming with simple Windows controls including brushes, pens, text and fonts, keyboard and mouse events, times, scroll bars, menus, dialog boxes, toolbars and status bars, tree view, list view and printing.
2. Book is well written in a tutorail way, easy to understand.

3. Not much for an advanced developer. If you're looking for some advanced stuff, you may be disappointed.

Overall a must have for .NET beginners and intermediate developers.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews











Only search this product's reviews



Inside This Book (learn more)
First Sentence:
In that succinct and (perhaps consequently) much-beloved classic tutorial The C Programming Language, authors Brian Kernighan and Dennis Ritchie begin by presenting what has come to be known as the hello-world program: #include <stdio.h> main() { printf("hello. world\n"):} While such a program hardly exploits the power of today's computers, it's certainly useful on the practical level because it gives the eager student programmer the opportunity to make sure that the compiler and all its associated files are correctly installed. Read the first page
Key Phrases - Capitalized Phrases (CAPs): (learn more)
Charles Petzold, Type Property Accessibility, Times New Roman, Programming Windows, Event Method Delegate Argument, Visual Studio, Windows Explorer, Control Panel, Caps Lock, Courier New, New York, United States, Control Events, Edit Paste, Enumeration Member Value None, Command Prompt, Microsoft Windows, Annabel Lee, Control Methods, False False False, File Interchange Format, Num Lock, Edit Copy, Hello World, Aunt Polly
New!
Books on Related Topics | Concordance | Text Stats
Browse Sample Pages:
Front Cover | Table of Contents | First Pages | Index | Surprise Me!
Search Inside This Book:





Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 

Your tags: Add your first tag
 

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 

Search Customer Discussions
Search all Amazon discussions
   


Listmania!


So You'd Like to...


Create a guide


Look for Similar Items by Category


Look for Similar Items by Subject