
WPF 控件详细整理文档本文档基于 .NET WPF 内置控件整理涵盖控件分类、功能描述、继承信息、常用属性与事件说明适用于桌面应用开发者。 一、控件分类总览分类描述布局控件控制子元素位置与排列内容控件只能包含一个子元素条目控件显示多个数据项输入控件用户输入文本或选择媒体控件显示图像、音频、视频文档控件显示富文本或文档对话框控件提供文件选择、打印等交互状态控件显示状态信息或进度日期控件提供日期选择功能导航控件提供页面或标签导航 二、布局控件Layout Controls控件名描述常用属性Grid行列布局RowDefinitions,ColumnDefinitionsStackPanel水平或垂直堆叠OrientationWrapPanel自动换行布局Orientation,ItemWidthDockPanel停靠布局LastChildFillCanvas绝对定位Left,TopBorder边框容器BorderBrush,BorderThicknessScrollViewer滚动容器HorizontalScrollBarVisibilityViewbox自动缩放内容StretchExpander可折叠容器IsExpanded,HeaderGroupBox带标题容器HeaderTabControl标签页容器ItemsSource,SelectedIndexSeparator分隔线- 三、内容控件Content Controls控件名描述常用属性Button按钮Command,ContentLabel文本标签ContentCheckBox复选框IsCheckedRadioButton单选按钮IsChecked,GroupNameToggleButton开关按钮IsCheckedToolTip提示框Content,PlacementFrame页面容器Source,NavigationUIVisibilityPage页面Title 四、条目控件Items Controls控件名描述常用属性ListBox列表选择ItemsSource,SelectedItemComboBox下拉列表ItemsSource,SelectedValueListView多列列表View,ItemsSourceTreeView树形结构ItemsSource,SelectedItemDataGrid数据表格ItemsSource,AutoGenerateColumnsTabControl标签页ItemsSource,SelectedIndexToolBar工具栏Items,Orientation✍️ 五、输入控件Input Controls控件名描述常用属性TextBox文本输入Text,MaxLength,TextWrappingPasswordBox密码输入Password,PasswordCharRichTextBox富文本输入DocumentSlider滑块Value,Minimum,MaximumDatePicker日期选择SelectedDateCalendar日历控件SelectedDate,DisplayMode️ 六、媒体与图形控件控件名描述常用属性Image显示图片Source,StretchMediaElement播放音视频Source,LoadedBehaviorInkCanvas手写/绘图DefaultDrawingAttributesShape系列绘制图形Fill,Stroke 七、文档控件Document Controls控件名描述常用属性TextBlock轻量级文本显示Text,TextWrappingRichTextBox富文本编辑DocumentFlowDocumentReader文档阅读器DocumentFlowDocumentScrollViewer滚动文档查看DocumentFlowDocumentPageViewer分页文档查看Document️ 八、对话框控件Dialog Controls控件名描述常用属性OpenFileDialog打开文件Filter,FileNameSaveFileDialog保存文件Filter,FileNamePrintDialog打印文档PrintQueueMessageBox消息提示- 九、状态控件Status Controls控件名描述常用属性ProgressBar进度条Value,Maximum,IsIndeterminateStatusBar状态栏Items 十、日期控件Date Controls控件名描述常用属性Calendar日历选择SelectedDate,DisplayModeDatePicker日期选择器SelectedDate,Text 十一、导航控件Navigation Controls控件名描述常用属性Hyperlink超链接NavigateUriFrame页面导航容器Source,JournalOwnershipNavigationWindow导航窗口SourceTabControl标签页导航SelectedIndex,ItemsSource 十二、其他常用控件控件名描述ContextMenu右键菜单Menu菜单栏ToolTip提示框Popup弹出层WebBrowser嵌入网页StatusBar状态栏Separator分隔符 十三、控件继承关系简略Control ├── ContentControl │ ├── Button │ ├── Label │ ├── CheckBox │ ├── RadioButton │ └── ToolTip ├── ItemsControl │ ├── ListBox │ ├── ComboBox │ ├── ListView │ ├── TreeView │ └── DataGrid ├── TextBoxBase │ ├── TextBox │ └── RichTextBox ├── RangeBase │ ├── Slider │ └── ProgressBar