Wpf 简明教程
WPF - Controls
Windows Presentation Foundation(WPF) 使得开发人员可以轻松地构建和创建视觉丰富的基于 UI 的应用程序。
Windows Presentation Foundation (WPF) allows developers to easily build and create visually enriched UI based applications.
-
The classical UI elements or controls in other UI frameworks are also enhanced in WPF applications.
-
All of the standard WPF controls can be found in the Toolbox which is a part of the System.Windows.Controls.
-
These controls can also be created in XAML markup language.
WPF 控件的完整继承层次关系如下:
The complete inheritance hierarchy of WPF controls are as follows −

下表包含我们将在后续章节中讨论的控件列表。
The following table contains a list of controls which we will discuss in the subsequent chapters.
Sr. No. |
Controls & Description |
1 |
ButtonA control that responds to user input |
2 |
CalendarRepresents a control that enables a user to select a date by using a visual calendar display. |
3 |
CheckBoxA control that a user can select or clear. |
4 |
ComboBoxA drop-down list of items a user can select from. |
5 |
ContextMenuGets or sets the context menu element that should appear whenever the context menu is requested through user interface (UI) from within this element. |
6 |
DataGridRepresents a control that displays data in a customizable grid. |
7 |
DatePickerA control that lets a user select a date. |
8 |
DialogsAn application may also display additional windows to help the user gather or display important information. |
9 |
GridViewA control that presents a collection of items in rows and columns that can scroll horizontally. |
10 |
ImageA control that presents an image. |
11 |
LabelDisplays text on a form. Provides support for access keys. |
12 |
ListBoxA control that presents an inline list of items that the user can select from. |
13 |
MenusRepresents a Windows menu control that enables you to hierarchically organize elements associated with commands and event handlers. |
14 |
PasswordBoxA control for entering passwords. |
15 |
PopupDisplays content on top of existing content, within the bounds of the application window. |
16 |
ProgressBarA control that indicates progress by displaying a bar. |
17 |
RadioButtonA control that allows a user to select a single option from a group of options. |
18 |
ScrollViewerA container control that lets the user pan and zoom its content. |
19 |
SliderA control that lets the user select from a range of values by moving a Thumb control along a track. |
20 |
TextBlockA control that displays text. |
21 |
ToggleButtonA button that can be toggled between 2 states. |
22 |
ToolTipA pop-up window that displays information for an element. |
23 |
WindowThe root window which provides minimize/maximize option, Title bar, border and close button |
24 |
3rd Party ControlsUse third-party controls in your WPF applications. |
我们将会逐一讨论所有这些控件及其实现。
We will discuss all these controls one by one with their implementation.