Glyph.GetHitTest メソッド
アセンブリ: System.Design (system.design.dll 内)

Dim instance As Glyph Dim p As Point Dim returnValue As Cursor returnValue = instance.GetHitTest(p)
戻り値
Glyph が p に関連付けられている場合は Cursor。それ以外の場合は null 参照 (Visual Basic では Nothing)。

GetHitTest メソッドは、ヒット テスト ロジックを提供するための Glyph が実装された abstract メソッドです。任意のポイントを指定したときに、Glyph がその位置に置かれるように設定されている場合は、有効な Cursor を返す必要があります。それ以外の場合は null 参照 (Visual Basic では Nothing) が返され、BehaviorService はその位置を無視します。

GetHitTest をオーバーライドしてポイントがこのグリフ内にあるかどうか調べる方法を次の例に示します。このコード例は、BehaviorService クラスのトピックで取り上げているコード例の一部分です。
Public Overrides Function GetHitTest(ByVal p As Point) As Cursor ' GetHitTest is called to see if the point is ' within this glyph. This gives us a chance to decide ' what cursor to show. Returning null from here means ' the mouse pointer is not currently inside of the glyph. ' Returning a valid cursor here indicates the pointer is ' inside the glyph,and also enables our Behavior property ' as the active behavior. If Bounds.Contains(p) Then Return Cursors.Hand End If Return Nothing End Function
public override Cursor GetHitTest(Point p) { // GetHitTest is called to see if the point is // within this glyph. This gives us a chance to decide // what cursor to show. Returning null from here means // the mouse pointer is not currently inside of the glyph. // Returning a valid cursor here indicates the pointer is // inside the glyph, and also enables our Behavior property // as the active behavior. if (Bounds.Contains(p)) { return Cursors.Hand; } return null; }


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からGlyph.GetHitTest メソッドを検索する場合は、下記のリンクをクリックしてください。

- Glyph.GetHitTest メソッドのページへのリンク