Summary of WPF controls and summary of wpf controls

Source: Internet
Author: User

Summary of WPF controls and summary of wpf controls

 

Content Control:
1. Button:
When Button. IsCancel = "True", click the Button to close the dialog box. When Button. IsDefault = "True", Press enter to trigger the Click Event of the Button.
2. RepeatButton:
The appearance is the same as that of the Button, and the behavior is basically the same. The difference is that when you press and hold the RepeatButton, click events are continuously triggered. The frequency of triggering events is determined by the attribute Delay and Interval. At the same time, RepeatButton does not cancel or default the two actions.
3. ToggleButton:
The appearance is exactly the same as that of the Button, and the two actions are not canceled or defaulted. I call it a "Concave" Button and click "Concave" (The IsChecked attribute is true) click "convex" (The IsChecked attribute is false ).
4. CheckBox:
CheckBoxt and ToggleButton only differ in appearance.
5. RadioButton:
Put RadioButton in A group. Only one RadioButton can be selected at a time, which is called "mutual exclusion". However, you cannot deselect your own selection by selecting itself (CheckBox is acceptable ), it can be done through programming.
Simple container:
1. Label:
You can use the Content attribute (non-text attribute) to store any Content (such as the Button Menu), but the Label is only useful for text.
2. ToolTip:
Put the content in the floating box, but it must be assigned to the ToolTip attribute of another element. It cannot be directly placed in the UI element tree.
3. Frame:
The behavior of a WPF Frame is similar to that of an HTML Frame. It can also contain any Content. If both the Source and Content attributes are set, the Content takes precedence.
Containers with headers:
1. GroupBox:
GroupBox usually contains multiple items or only one item. The Header and Content attributes can contain any object (such as Button ).
2. Expander:
Expander is similar to GroupBox, but Expander can be expanded or collapsed (collapsed by default). The buttons in Expander are actually ToggleButton, but they only change the UI.
Items Control
1. ComboBox:
ComboBox implicitly includes every Item in the ComboBoxItem object. Of course, it can also explicitly include any Item in a ComboBoxItem. ComboBoxItem is also a content control. ComboBox allows you to enter Text in the selection box. If the Text is the same as an existing Item and is selected, no Item is selected, but the Text is stored in the Text attribute.
2. ListBox:
The ListBox and ComboBox are similar, but all items in the ListBox are displayed, or they are displayed as a scroll bar.
3. ListView:
ListView and ListBox are very similar. ListView provides View attributes to customize View templates.
4. TabControl:
It can be used to switch between multiple pages.
Menu
1. Menu:
A Menu is an item that is placed horizontally. items in a Menu can be anything, But MenuItem and Separator (Separator) objects are recommended.
2. ContextMenu (context menu ):
It works the same way as Menu, but cannot be directly placed in the element tree. It can only be loaded to other controls through properties. When you right-click the control, the menu is displayed.
3. TreeView:
You can expand or collapse nodes to display data hierarchically.
4. ToolBar:
It groups many small buttons or other controls.
5. StatusBar:
It is usually used to display the status information at the bottom of the window.
Range control
1. ProgressBar:
Control that displays the progress.
2. Slider:
You can change the current value by moving the cursor on the scale.
Text Control
1. TextBox:
You can enter one or more lines of Text. The Content is stored in the Text attribute (not the Content attribute.
2. RichTextBox:
RichTextBox is an advanced TextBox that can contain formatted Text. The content is stored in the Document (FlowDocument type) attribute (not the Text attribute,
3. PasswordBox:
PasswordBox is a simple TextBox that displays the entered text (password! Of course you cannot see it ).
4. InkCanvas:
Controls for writing or painting with the mouse or pointer. (Indicator pen: pen tip for writing, pen end and to wipe)
Layout Control
1. Canvas:
The elements in the control are located by coordinates.
2. StackPanel:
The elements in the control are arranged from left to right or from top to bottom.
3. WrapPanel:
WrapPanel is similar to StackPanel. The difference is that when there is not enough space, elements will wrap or change columns by themselves.
4. DockPanel:
I call it a "magnet" control, which allows the elements to "adsorbed" on a certain edge. And stretch the element to fill in all width or height.
5. Grid:
Similar to the table in HTML.
6. TabPanel:
Simplified WrapPanel.
7. ToolBarOverflowPanel:
It is also a simplified WrapPanel.
8. ToolBarTray:
Only child elements of the ToolBar are supported, and the ToolBar is arranged horizontally.
9. UniformGrid:
Is a simplified Grid. The size settings of all rows and columns are * and cannot be changed.
10. ScrollBar:
Display the content in a scrolling manner.
11. ViewBox:
ViewBox can have only one child element. By default, ViewBox is stretched in two directions to provide sufficient space for its content. However, it also provides a Stretch attribute to control the scaling of its unique child element within its boundary.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.