The control does not expose a HitTest method; the closest equivalent would be the UIElement.ElementFromPoint method. The following code sample demonstrates how to use that to determine whether the user clicked on an image:
private void ultraListView1_MouseDown(object sender, MouseEventArgs e){ UltraListView listView = sender as UltraListView; bool a = this.HitTest( listView, typeof(UltraListViewImageUIElement), e.Location ); bool stop = true;}
private bool HitTest( UltraListView listView, Type elementType, Point point ){ if ( listView == null || elementType == null ) return false;
UIElement controlElement = listView.UIElement; UIElement elementAtPoint = controlElement != null ? controlElement.ElementFromPoint( point ) : null;
while ( elementAtPoint != null ) { if ( elementAtPoint.GetType() == elementType ) return true;
elementAtPoint = elementAtPoint.Parent; }
return false;}