windowsforms-devexpress-dot-xtraeditors-dot-tileitem-c8ebdd10.md
Fires when a user presses the current tile.
Namespace : DevExpress.XtraEditors
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DXCategory("Behavior")]
public event TileItemClickEventHandler ItemPress
<DXCategory("Behavior")>
Public Event ItemPress As TileItemClickEventHandler
The ItemPress event's data class is TileItemEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Item | Gets or sets a TileItem that caused firing a related event. |
The TileItem.ItemPress and TileControl.ItemPress events are raised immediately after a user presses a tile (before this tile is released). After a tile is released, the control raises the TileControl.ItemClick and TileItem.ItemClick events.
When a user starts to drag a tile, the ItemPress events fire. The ItemClick events do not fire in this case.
If your users use touch screens, and you want to handle the ItemPress event to display a modal window when a user taps on a touch screen, wrap your code that displays the modal window within the Control.BeginInvoke method. For example, you can use the following code:
private void tileItem1_ItemPress(object sender, TileItemEventArgs e) {
this.BeginInvoke(new MethodInvoker(delegate {
(new Form2()).ShowDialog();
}));
}
Private Sub TileItem1_ItemPress(sender As Object, e As DevExpress.XtraEditors.TileItemEventArgs) Handles TileItem1.ItemPress
Me.BeginInvoke(New MethodInvoker(Sub()
Call (New Form2()).ShowDialog()
End Sub))
End Sub
See Also
ItemPress