ImageClickEventArgs Classe
Definição
Fornece dados para os eventos que ocorrem quando um usuário clica em um controle de servidor do ASP.NET baseado em imagem, como os controles de servidor HtmlInputImage ou ImageButton.Provides data for any events that occur when a user clicks an image-based ASP.NET server control, such as the HtmlInputImage or ImageButton server controls. Essa classe não pode ser herdada.This class cannot be inherited.
public ref class ImageClickEventArgs sealed : EventArgs
public sealed class ImageClickEventArgs : EventArgs
type ImageClickEventArgs = class
inherit EventArgs
Public NotInheritable Class ImageClickEventArgs
Inherits EventArgs
- Herança
Exemplos
O exemplo de código a seguir demonstra uma página ASP.NET que usa as informações fornecidas por essa classe para exibir as coordenadas do clique de um usuário em uma imagem.The following code example demonstrates an ASP.NET page that uses the information provided by this class to display the coordinates of a user's click on an image.
// Define the event handler that uses coordinate information through ImageClickEventArgs.
void ImageButton_Click(object sender, ImageClickEventArgs e)
{
Label1.Text = "You clicked the ImageButton control at the coordinates: (" +
e.X.ToString() + ", " + e.Y.ToString() + ")";
}
' Define the event handler that uses coordinate information through ImageClickEventArgs.
Sub ImageButton_Click(sender As Object, e As ImageClickEventArgs)
Label1.Text = "You clicked the ImageButton control at the coordinates: (" & _
e.X.ToString() & ", " & e.Y.ToString() & ")"
End Sub
Comentários
Essa classe passa o local onde um usuário clicou em um HtmlInputImage controle de servidor ou um ImageButton controle de servidor Web.This class passes the location where a user clicked an HtmlInputImage server control or an ImageButton Web server control. Clicar em um HtmlInputImage controle de servidor faz com que um ServerClick evento ocorra, enquanto clicar em um ImageButton controle de servidor faz com que ocorra um Click evento.Clicking an HtmlInputImage server control causes a ServerClick event to occur, while clicking an ImageButton server control causes a Click event to occur. Em seguida, você pode usar manipuladores de eventos para responder programaticamente ao evento com base no valor dessas coordenadas.You can then use event handlers to programmatically respond to the event based on the value of these coordinates.
Observação
As coordenadas de origem (0, 0) estão localizadas no canto superior esquerdo da imagem.The origin coordinates (0,0) are located at the upper left corner of the image.
A geração de um evento invoca o manipulador de eventos por meio de um delegado.Raising an event invokes the event handler through a delegate. Para obter mais informações, consulte manipulando e gerando eventos.For more information, see Handling and Raising Events.
Construtores
| ImageClickEventArgs(Int32, Int32) |
Inicializa uma nova instância da classe ImageClickEventArgs usando os parâmetros |
| ImageClickEventArgs(Int32, Int32, Double, Double) |
Inicializa uma nova instância da classe ImageClickEventArgs usando os parâmetros |
Campos
| X |
Um inteiro que representa a coordenada X em que um usuário clicou em um controle de servidor ASP.NET baseado em imagem.An integer that represents the x-coordinate where a user clicked an image-based ASP.NET server control. |
| XRaw |
Um inteiro que representa a coordenada X bruta em que um usuário clicou em um controle de servidor ASP.NET baseado em imagem.An integer that represents the raw x-coordinate where a user clicked an image-based ASP.NET server control. |
| Y |
Um inteiro que representa a coordenada Y em que um usuário clicou em um controle de servidor ASP.NET baseado em imagem.An integer that represents the y-coordinate where a user clicked an image-based ASP.NET server control. |
| YRaw |
Um inteiro que representa a coordenada Y bruta em que um usuário clicou em um controle de servidor ASP.NET baseado em imagem.An integer that represents the raw y-coordinate where a user clicked an image-based ASP.NET server control. |
Métodos
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object. (Herdado de Object) |
| GetHashCode() |
Serve como a função de hash padrão.Serves as the default hash function. (Herdado de Object) |
| GetType() |
Obtém o Type da instância atual.Gets the Type of the current instance. (Herdado de Object) |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
| ToString() |
Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object. (Herdado de Object) |