windows forms programming with c#

754 10.7K 0
windows forms programming with c#

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Components The Component class represents an object that is marshaled by reference and can exist within a container. This figure shows the complete set of Windows Forms classes derived from the System.ComponentModel.Component class. The CommonDialog class represents a component that provides a standard interface for common functionality required by Windows Forms applications. This figure shows the com- plete set of Windows Forms classes derived from the System.Windows.Forms.Common- Dialog class. Common dialogs Windows Forms Programming with C# ERIK BROWN MANNING Greenwich (74° w. long.) For online information and ordering of this and other Manning books, go to www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact: Special Sales Department Manning Publications Co. 209 Bruce Park Avenue Fax: (203) 661-9018 Greenwich, CT 06830 email: orders@manning.com ©2002 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Manning Publications Co. Copyeditor: Lois Patterson 209 Bruce Park Avenue Typesetter: Syd Brown Greenwich, CT 06830 Cover designer: Leslie Haimes ISBN 1930110-28-6 Printed in the United States of America 12345678910–VHG–0605040302 In memory of Thelma Rose Wilson, and for her beautiful daughter whom I love vii brief contents Part 1 Hello Windows Forms 1 1 Getting started with Windows Forms 3 2 Getting started with Visual Studio .NET 34 Part 2 Basic Windows Forms 67 3 Menus 69 4 Status bars 102 5 Reusable libraries 126 6 Common file dialogs 161 7 Drawing and scrolling 194 8 Dialog boxes 224 9 Basic controls 263 10 List controls 314 11 More controls 353 12 A .NET assortment 383 13 Toolbars and tips 410 Part 3 Advanced Windows Forms 437 14 List views 439 15 Tree views 485 16 Multiple document interfaces 525 17 Data binding 564 18 Odds and ends .NET 603 ix contents brief contents vii contents ix preface xix about this book xxi acknowledgments xxviii about .NET xxx about the cover illustration xxxiv Part 1 Hello Windows Forms 1 1 Getting started with Windows Forms 3 1.1 Programming in C# 4 Namespaces and classes 6 ✦ Constructors and methods 8 ✦ C# types 9 ✦ The entry point 11 The Application class 11 ✦ Program execution 13 1.2 Adding controls 13 Shortcuts and fully qualified names 15 Fields and properties 16 ✦ The Controls property 18 1.3 Loading files 18 Events 20 ✦ The OpenFileDialog class 22 Bitmap images 24 1.4 Resizing forms 26 Desktop layout properties 28 ✦ The Anchor property 29 ✦ The Dock property 31 1.5 Recap 33 [...]... book on programming with the NET Framework, I welcomed the idea As events unfolded, I found myself with some fairly strong opinions about how such a book should be organized, and offered up a proposal to write a solo book on programming Windows Forms applications I have always enjoyed the book Programming Windows 95 with MFC by Jeff Prosise, so a book about developing Windowsbased applications with the... about Windows Forms, Microsoft’s new interactive development environment Visual Studio NET is an important part of creating NET applications To introduce both Windows Forms and Visual Studio NET, we will create the same program in two subsequent chapters Chapter 1 is titled “Getting started with Windows Forms. ” This chapter introduces Windows Forms programming and covers some fundamentals of the C# language... mind: • Windows programmers interested in developing desktop applications with NET • Developers familiar with NET or C# interested in learning more about Windows Forms classes and programming • C++ programmers with little or no experience creating Windows applications Once again, I should point out that this book examines one portion of the NET Framework, namely the classes contained in the System .Windows. Forms. .. organized into three parts PART 1: HELLO WINDOWS FORMS The first part of the book introduces fundamental concepts behind C# in general and Windows Forms specifically Chapter 1 creates the application shown in figure 1 using a text editor We discuss how a Windows Forms application is executed by the NET Framework, and how a Windows Forms program is structured in C# In chapter 2 we begin using Visual Studio... in appendix B THE WINDOWS FORMS NAMESPACE In addition to imposing structure on the vast collection of objects supported by the NET Framework, the namespace concept also provides some direction and focus for writing a book This book focuses on the System .Windows. Forms namespace, xix affectionately known as Windows Forms Windows Forms applications are programs that are executed by the Windows operating... throughout the Windows Forms namespace whenever a group of objects is required The Container class encapsulates the container concept, with the IContainer interface defining the members required by all containers A control is a component with a visual aspect In the Windows Forms namespace, a control is a component that presents a graphical interface on the Windows desktop The Windows Forms Control class,... business with book covers based on the colorful tapestry of regional life of two centuries ago brought back to life by the pictures from this collection WINDOWS FORMS OVERVIEW xxxiii P A R T 1 Hello Windows Forms I t is common practice to write some sort of “Hello” program at the beginning of a book This book is no different, and we begin our discussion on Windows Forms with the most basic of forms: ... application THE WINDOWS FORMS NAMESPACE xxi Figure 3 The MyPhotos application from chapter 18 A parent window now exists within which the MyPhotos window from part 2 of the book is displayed WHO SHOULD READ THIS BOOK? Like any author, I would like everyone to read this book The more the merrier! In the interest of full disclosure, however, I wrote Windows Forms Programming with C# with three kinds... chapter 6, “Common dialogs,” makes use of this library WINDOWS FORMS OVERVIEW xxxi about the cover illustration The figure on the cover of Windows Forms Programming with C# is a “Pescador del Cabo de buena Esperanza,” a fisherman from the Cape of Good Hope in Africa This fisherman is especially appropriate here, since the author, Erik Brown, worked with the U.S Peace Corps in Botswana, which is not too... part 1 PART 2: BASIC WINDOWS FORMS In part 2 we begin a systematic approach to the classes in the Windows Forms namespace This part continues the development of our MyPhotos application, shown in figure 2 as it appears in chapter 13 As you can see, part 2 covers the core user interface components required to build Windows Forms applications, including menus, status bars, dialog windows, text boxes, . required by Windows Forms applications. This figure shows the com- plete set of Windows Forms classes derived from the System .Windows. Forms. Common- Dialog class. Common dialogs Windows Forms Programming. love vii brief contents Part 1 Hello Windows Forms 1 1 Getting started with Windows Forms 3 2 Getting started with Visual Studio .NET 34 Part 2 Basic Windows Forms 67 3 Menus 69 4 Status bars 102 5. illustration xxxiv Part 1 Hello Windows Forms 1 1 Getting started with Windows Forms 3 1.1 Programming in C# 4 Namespaces and classes 6 ✦ Constructors and methods 8 ✦ C# types 9 ✦ The entry point

Ngày đăng: 06/07/2014, 01:22

Từ khóa liên quan

Mục lục

  • Inside front cover

  • brief contents

    • Part 1 Hello Windows Forms1

    • Part 2 Basic Windows Forms67

    • Part 3 Advanced Windows Forms437

    • contents

    • preface

    • about this book

    • The Windows Forms namespace

      • Part 1: Hello Windows Forms

      • Part 2: Basic Windows Forms

      • Part 3: Advanced Windows Forms

      • Who should read this book?

      • Conventions

        • Action

        • Result

        • Source code downloads

        • Author online

          • acknowledgments

          • about .NET

          • Casting the .NET

          • Windows Forms overview

            • about the cover illustration

              • Hello Windows Forms

              • chapter1

                • Getting started with Windows Forms

                • 1.1 Programming in C#

                  • 1.1.1 Namespaces and classes

Tài liệu cùng người dùng

Tài liệu liên quan