这是一本 Hello World 级的 C# 窗体编程的入门好书,配有详细图解和源代码。
本书是打开 Windows Forms 编程之门的金钥匙,它所采用的编程语言是当前最为流行、最具潜力的 C#。本书内容详尽充实,共分为3个部分:初识WindowsForms、Windows Forms 基础和高级 Windows Forms。通过本书的学习,读者能够迅速掌握通过 .NET Framework 开发 Windows Forms 程序的所有相关技术。
无论对开发桌面应用程序的 Windows 程序员,还是正在学习 Windows Forms 知识的开发人员,或者是毫无Windows开发经验的初学者,相信本书都是最佳的选择。
在 .NET 环境中,GUI 元素--菜单、按钮、列表、树,当然还有窗口本身--都要通过WindowsForms框架来创建和使用。Windows Forms 是一个面向对象的类集,为丰富的 Windows 应用程序开发提供了高效、现代的编程环境。 本书围绕 Windows Forms 这个公共主题列举了大量示例,涵盖了 Windows Forms 编程的基础(如标签、菜单和按钮)以及高级概念(如自绘制列表、浏览器风格界面和自定义数据绑定)。
本书的目标读者是充满求知欲的初、中级程序员。
本书主要内容。
● 自绘制列表框
● 列表和树型视图
● 多文档界面
● 数据网格和数据绑定
● 拖放
● 实现可重用程序库、自动填充的组合框、键盘和鼠标处理、 打印和打印预览以及嵌入式Web浏览器
The .NET Framework contains such a large selection of topics that it is impossible to cover all of them in a single book of any depth. This section introduces the focus of this book, and provides an overview of the contents and conventions used in the text.
The end of this section describes the online forum available for any questions or comments on the book, and explains how the source code used in the book can be downloaded from the Internet. Before we discuss the book specifically, we should introduce the concept of namespaces. A namespace defines a group, or scope, of related classes, structures, and other types. A namespace is a bit like a family: it defines a group of distinct members with a common name and some shared sense of purpose.
All objects in the .NET Framework, and indeed in C# itself, are organized into namespaces. The System namespace, for example, includes objects related to the framework itself, and most namespaces defined by .NET are nested within the System namespace. The System.Windows namespace defines types and namespaces related to the Windows operating system, while the System.Web namespace defines types and namespaces related to web pages and servers.
This organization into namespaces permits two objects with the same base name to be distinct, much like two people can both share the same first name. For example, the Button class in the System.Web.UI.WebControls namespace represents a button on a web page, while the Button class in the System.Windows.Forms namespace represents a button in an application window. Other namespaces in .NET include the System.IO namespace for file and directory related objects, the System.
Data namespace for database-related objects, the System.Drawing namespace for graphical objects, and the System.Security namespace for security objects. An overview of the more commonly used namespaces in .NET is provided in appendix B.
