WPF Universal Control Events

Source: Internet
Author: User

WPF Universal Control Events

Click: Occurs when the control is clicked. In some cases, such an event can also occur when the user presses the ENTER key.

Drop: Occurs when the drag operation is complete, that is, when the user drags an object on the control and then releases the mouse.

DragEnter: Occurs when an object is dragged into the edge range of the control

DragLeave: Occurs when an object is dragged out of the bounds of the control

DragOver: Occurs when an object is dragged onto the control

KeyDown: Occurs when the control has the focus and a key is pressed. This event always occurs before the KeyPress and KeyUp events

KeyUp: Occurs when the control has focus and a key is released. This event always occurs after the Keydowm event

GotFocus: Occurs when the control loses focus. Do not use the control to perform validation operations on the control. You should use validating and validated instead.

MouseDoubleClick: Occurs when the control is double-clicked

MouseDown: Occurs when the mouse pointer passes over a control and the mouse button is pressed. This event is not the same as the Click event because the MouseDown event occurs before it is released when the button is pressed

MouseMove: Occurs continuously when the mouse passes over the control

MouseUp: Occurs when the mouse pointer passes over the control while the mouse button is released

Pancel Layout Controls

canvas--the control allows child controls to be placed in any appropriate way. It does not impose any restrictions on the position of the child controls, but does not provide any assistance for placement.

dockpanel--the control allows the child controls to snap to either side of their four edges. The last child control can fill the remaining area.

grid--the control makes the child controls more flexible to position. You can divide the layout of the control into rows and columns so that the control is aligned in the network layout.

stackpanel--the control arranges the child controls in a horizontal or vertical direction.

wrappanel--As with StackPanel, the control arranges the child controls horizontally or vertically, but it is not sorted by one row or column, but is arranged in multiple rows and columns depending on the amount of free space available.

Canvas:

 <CanvasBackground= "AliceBlue">        <RectangleCanvas.Left= " the"Canvas.Top= " the"Height= "Max"Width= "+"Stroke= "Black"Fill= "Chocolate"/>        <RectangleCanvas.Left= "198"Canvas.Top= "121"Height= "Max"Width= "+"Stroke= "Black"Fill= "Bisque"/>    </Canvas>


Note: Excerpt from "C # Getting Started classic"

WPF Universal Control Events

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.