1. Trang chủ
  2. » Công Nghệ Thông Tin

Manning Windows Forms Programming (phần 1) pdf

50 464 0

Đ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

Thông tin cơ bản

Định dạng
Số trang 50
Dung lượng 650,84 KB

Nội dung

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 [...]... 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... discussion on Windows Forms with the most basic of forms: an empty window While this book is all 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. ”... contains 18 chapters 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... 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,... 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,... normally hope for So when Manning Publications asked me if I would contribute to a 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... 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. .. Windows operating system, and that employ the user interface features familiar to Windows desktop users everywhere The book attempts to provide a somewhat methodical approach to the Windows Forms namespace Most of the types defined by this namespace are covered in the book Appendix C provides a class diagram of the Windows Forms namespace, and includes a reference to the location in the book where each... both long and brief While the NET Framework is based on programming languages and development environments that came years before, it is relatively new and its success in the marketplace is yet to be proven This section provides an abbreviated history of the C# programming language, pronounced see-sharp, and the NET Windows Forms functionality The C programming language was originally developed in the... single offering called the NET Framework WINDOWS FORMS OVERVIEW As we mentioned in the About this book section, all objects in the NET Framework, and indeed in C# itself, are organized into namespaces Appendix B provides an overview of the more commonly-used namespaces defined by the NET Framework This book focuses on the System .Windows. Forms namespace used to build Windows- based applications This section . 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. 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

Ngày đăng: 07/07/2014, 04:20

TỪ KHÓA LIÊN QUAN