Free Programming Books
Free download ebooks on computer and programming

Free ebook "Programming .NET Windows Applications" Sample Chapter

Programming .NET Windows ..
Free download chapter 10: Drawing and GDI+
Download chapter

For those of you who develop standalone Windows applications for PCs and other devices, Microsoft's .NET Windows Forms provide a much better way to get it done. This new technology gives you more power and flexibility for a fraction of the effort compared to classic Win32 development, with a streamlined programming model that deals automatically with many tedious details that once plagued developers. As with most things .NET, the only hitch is the learning curve. But that's where acclaimed author Jesse Liberty makes the difference with Programming .NET Windows Applications. With this tutorial, you will explore all aspects of using .NET Windows Forms class libraries and the associated programming tools in Visual Studio .NET, enabling you to build applications for the Windows 9x, Windows 2000 and Windows XP desktop platforms. Step-by-step, you'll learn ways to design applications that either function alone on a PC, or work in combination with your web-based application server to take advantage of the richer interface and higher level of security. The book also explains how your new Windows applications can sidestep problems that used to arise from the use of DLLs (known collectively as "DLL hell"), and how .NET Windows Forms can be used as an alternative to ASP.NET and browser-based approaches for building web application clients. Jesse Liberty definitely knows his stuff when it comes to the .NET platform. As the author of O'Reilly's Programming C# and Learning Visual Basic .NET, he's well-known for his clear and concise style that prompted one reviewer to say, "It's as if he knows exactly what questions I'm going to ask ahead of time." Jesse also co-authored Programming ASP.NET with contract programmer Dan Hurwitz, and now the two have teamed up again to bring you this comprehensive tutorial--without a doubt, the best source available for learning how to program with .NET Windows Forms. review "Programming C#" ebook

< < prev next > >

Drawing and GDI+

The designers of .NET, and especially of Visual Studio .NET, clearly had in mind a model in which you could write sophisticated Windows Applications using only the controls available in the Toolbox. This approach is very successful, and many Windows programmers will never need to go beyond the Toolbox and forms model for building powerful user interfaces.

As discussed elsewhere in this book, the Toolbox includes controls for displaying data (labels, DataGrids, Calendars, listboxes, etc.) as well as for offering the user choices (radio buttons, checkboxes, listboxes, etc.) and for gathering data (text boxes, etc.) In addition, several controls and components manage date and time (Timer, etc.) or the form itself (splitter, etc.).

From time to time, however, you will want to display data in a way that is not possible with just the controls offered in the Toolbox. You might wish to draw on a control, or directly on the form itself, and for that you'll need the tools made available through GDI+ and the Graphics object.

To get an idea of what you can accomplish with these tools, this chapter first covers the basics with simple demonstration programs. It then focuses on a small but complete project, in which you will create an analog clock.