ImageClickEventArgs Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. 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
- Inheritance
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
This class passes the location where a user clicked an HtmlInputImage server control or an ImageButton Web server control. Clicking an HtmlInputImage server control causes a ServerClick event to occur, while clicking an ImageButton server control causes a Click event to occur. You can then use event handlers to programmatically respond to the event based on the value of these coordinates.
Note
The origin coordinates (0,0) are located at the upper left corner of the image.
Raising an event invokes the event handler through a delegate. For more information, see Handling and Raising Events.
Image |
Initializes a new instance of the ImageClickEventArgs class using the |
Image |
Initializes a new instance of the ImageClickEventArgs class using the |
X |
An integer that represents the x-coordinate where a user clicked an image-based ASP.NET server control. |
XRaw |
An integer that represents the raw x-coordinate where a user clicked an image-based ASP.NET server control. |
Y |
An integer that represents the y-coordinate where a user clicked an image-based ASP.NET server control. |
YRaw |
An integer that represents the raw y-coordinate where a user clicked an image-based ASP.NET server control. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
To |
Returns a string that represents the current object. (Inherited from Object) |
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: