WPF的功能比较强大,不过操作方法却很简单。因为它内置了许多WPF控件,帮助我们轻松实现图形界面显示功能。学习WPF,首先就要掌握这些控件。#t#
WPF控件类别包括:
按钮(Buttons): Button, RepeatButton
对话框(Dialog Boxes):打开文件对话框OpenFileDialog, 打印对话框PrintDialog, 文件保存对话框SaveFileDialog
数字化墨水(Digital Ink): 墨水面板InkCanvas,墨迹呈现器InkPresenter
文档(Documents): DocumentViewer, FlowDocumentPageViewer, FlowDocumentReader, FlowDocumentScrollViewer, StickyNoteControl
输入框(Input): TextBox, RichTextBox, PasswordBox
版面布局(Layout): Border, BulletDecorator, Canvas, Panel, DockPanel, WrapPanel,VirtualizingStackPanel,StackPanel, Expander, Grid, GridView, GridSplitter, GroupBox, ResizeGrip, Separator, ScrollBar, ScrollViewer, Thumb, Viewbox, , Window
媒体(Media): Image, MediaElement, SoundPlayerAction
菜单(Menus):Menu, ContextMenu, ToolBar
导航(Navigation):Frame, Hyperlink, Page, NavigationWindow, TabControl
选择(Selection):CheckBox, ComboBox, ListBox, TreeView, RadioButton, Slider
用户信息(User Information): AccessText, Label, Popup, ProgressBar, StatusBar, TextBlock, ToolTip
一些WPF控件中还可以包含更多的其他控件或对象[即所谓的“富内容(Rich Content)”]:
例如:一个Label可以包含如文字、图像,面板(Panel)等任何其他对象。下面类型WPF控件都支持这种“更丰富的包含”:
ContentControl: Window, Frame, ListBoxItem, GroupItem, Label, ScrollViewer, ToolTip, UserControl, StatusBarItem, Button等
ItemsControl: ListBox, HeaderedItemsControl,TreeView,Menu,Selector,StatusBar
HeaderedContentControl: TabItem, GroupBox, Expander
HeaderedItemsControl: MenuItem, TreeViewItem, ToolBar