Вы находитесь на странице: 1из 4

The Click event passes an EventArgs to its event handler.

Therefore, it only indicates that a click


has occurred. If you need more specific mouse information (such as the button, the number of
clicks, the wheel rotation, or the location), use the MouseClick event. However,
the MouseClickevent will not be raised if the click is caused by action other than that of the
mouse, such as pressing the ENTER key.
A double-click is determined by the mouse settings of the user's operating system. The user can
set the amount of time between clicks of a mouse button that determine what should be
considered a double-click instead of two clicks. The Click event is raised every time that a
control is double-clicked. For example, if you have event handlers for
the Click and DoubleClick events of a Shape, the Click and DoubleClick events are raised when
the shape is double-clicked, and both methods are called.

En el ejemplo de código siguiente se muestra cómo utilizar distintos eventos de mouse para
dibujar el trazo del mouse un Panel. Un segmento de línea se agrega a la GraphicsPath para
cada MouseMove y MouseDown eventos que se producen. Para actualizar los gráficos,
el Invalidate se llama el método para el Panel en
cada MouseDown y MouseUp eventos. Además, el trazado del gráfico se desplaza hacia arriba
o hacia abajo cuando el MouseWheel se produce el evento. Al igual que otros eventos de
mouse, MouseHover, se identifican en pantalla también. También se muestra en la pantalla es
información adicional sobre el mouse desde el SystemInformation clase.

 Call preventDefault() to prevent the browser default handling of


the data (default is open as link on drop)
 Get the dragged data with the dataTransfer.getData() method.
This method will return any data that was set to the same type in
the setData() method
 The dragged data is the id of the dragged element ("drag1")
 Append the dragged element into the drop element
as the keypress event isn't covered by any official specification, the actual
behavior encountered when using it may differ across browsers, browser versions,
and platforms.

This method is a shortcut for .on( "keypress", handler ) in the first two
variations, and .trigger( "keypress" ) in the third.

The keypress event is sent to an element when the browser registers keyboard
input. This is similar to the keydown event, except that modifier and non-printing
keys such as Shift, Esc, and delete trigger keydown events but
not keypressevents. Other differences between the two events may arise
depending on platform and browser.

After this code executes, clicks on Trigger the handler will also alert the
message.

If key presses anywhere need to be caught (for example, to implement global


shortcut keys on a page), it is useful to attach this behavior to the document object.
Because of event bubbling, all key presses will make their way up the DOM to
the document object unless explicitly stopped.

To determine which key was pressed, examine the event object that is passed to
the handler function. While browsers use differing properties to store this
information, jQuery normalizes the .which property so you can reliably use it to
retrieve the key code. This code corresponds to a key on the keyboard, including
codes for special keys such as arrows. For catching actual text
entry, .keypress() may be a better choice.
Si el CausesValidation propiedad se establece en false, Validating y Validated se suprimen los
eventos.
Nota la GotFocus y LostFocus son eventos de foco de bajo nivel que están vinculados a los
mensajes de Windows WM_KILLFOCUS y WM_SETFOCUS. Normalmente,
el GotFocus y LostFocus eventos sólo se utilizan al actualizar UICues o al escribir controles
personalizados. En su lugar el Enter y Leave eventos deben utilizarse para todos los controles
excepto la Form clase que usa el Activated y Deactivate eventos. Para obtener más información
acerca de la GotFocus y LostFocus los eventos, vea el WM_SETFOCUSyWM_KILLFOCUS temas.

En el ejemplo de código siguiente se muestra cómo validar el texto de TextBox1. También ilustra
el control de la LostFocus eventos estableciendo el FileDialog.InitialDirectory propiedad en el
texto de TextBox1. El ejemplo de código utiliza el ErrorProvider.GetError método para
comprobar los errores antes de abrir el cuadro de diálogo de archivo. Para ejecutar este
ejemplo, pegue el siguiente código en un formulario que contenga
un TextBox denominado TextBox1, un OpenFileDialog denominado OpenFileDialog1,
un Button denominado Button1, y un ErrorProviderdenominado ErrorProvider1. Asegúrese
de que todos los eventos están asociados a sus controladores de eventos.

´
The button number that was pressed when the
mouse event was fired: Left button=0, middle
button=1 (if present), right button=2. For mice
configured for left handed use in which the button
actions are reversed the values are instead read from
right to left.
The buttons being pressed when the mouse event
was fired: Left button=1, Right button=2, Middle
(wheel) button=4, 4th button (typically, "Browser
Back" button)=8, 5th button (typically, "Browser
Forward" button)=16. If two or more buttons are
pressed, returns the logical sum of the values. E.g., if
Left button and Right button are pressed, returns 3
(=1 | 2). More info.

Вам также может понравиться