バージョン

HasContext(Object) メソッド

この要素 (またはその祖先) が指定のコンテキストを持つ場合、True を返します。
シンタックス
'宣言
 
Public Overloads Function HasContext( _
   ByVal context As Object _
) As Boolean
public bool HasContext( 
   object context
)

パラメータ

context
オブジェクトのコンテキスト

戻り値の型

この要素 (またはその祖先) がこのコンテキストを持つ場合、True を返します。そうでない場合は False
使用例
Imports System.Windows.Forms
Imports Infragistics.Win
Imports System.Diagnostics

Private Sub UltraGrid1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles UltraGrid1.MouseMove

    If IsPointOverUltraGridActiveRow(New Point(e.X, e.Y)) Then
        Debug.WriteLine("Over Active Row")
    Else
        Debug.WriteLine("Not Over Active Row")
    End If

End Sub



Private Function IsPointOverUltraGridActiveRow(ByVal pt As Point) As Boolean

    Dim hitElement As UIElement = Me.UltraGrid1.DisplayLayout.UIElement.ElementFromPoint(pt)

    If hitElement.HasContext(Me.UltraGrid1.DisplayLayout.ActiveRow) Then
        Return True
    Else
        Return False
    End If

End Function
using System.Windows.Forms
using Infragistics.Win
using System.Diagnostics

private void ultraGrid1_MouseMove(object sender, MouseEventArgs e)
{

	if(IsPointOverUltraGridActiveRow(new Point(e.X,e.Y)))
		Debug.WriteLine("Over Active Row");
	else
		Debug.WriteLine("Not Over Active Row");

}

private bool IsPointOverUltraGridActiveRow(Point pt)
{

	UIElement hitElement = this.ultraGrid1.DisplayLayout.UIElement.ElementFromPoint(pt);

	if(hitElement.HasContext(this.ultraGrid1.DisplayLayout.ActiveRow))
		return true;
	else
		return false;

}
参照