Imports System.Diagnostics Imports Infragistics.Win Imports Infragistics.Win.UltraWinToolbars Private Sub GetToolbarItemUnderScreenPoint(ByVal screenPoint As Point) ' 現在のマウス位置の下にあるツールについての情報を表示します Dim toolUnderPoint As ToolBase = Me.UltraToolbarsManager1.ToolFromPoint(screenPoint) If Not toolUnderPoint Is Nothing Then Debug.WriteLine("The key of the tool under the point '" + screenPoint.ToString() + "' is '" + toolUnderPoint.Key + "'. The tool is of type '" + toolUnderPoint.GetType().ToString()) End If ' 現在のマウス位置の下にあるツールバーについての情報を表示します Dim toolbarUnderPoint As UltraToolbar = Me.UltraToolbarsManager1.ToolbarFromPoint(screenPoint) If Not toolbarUnderPoint Is Nothing Then Debug.WriteLine("The key of the tool under the point '" + screenPoint.ToString() + "' is '" + toolbarUnderPoint.Key + "'. It's current dock location is '" + toolbarUnderPoint.DockedPosition.ToString()) End If ' 現在のマウス位置の下にある UIElement についての情報を表示します Dim elementUnderPoint As UIElement = Me.UltraToolbarsManager1.UIElementFromPoint(screenPoint) If Not elementUnderPoint Is Nothing Then Debug.WriteLine("The key of the tool under the point '" + screenPoint.ToString() + "' is '" + elementUnderPoint.GetType().ToString()) End If End Sub
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinToolbars; private void GetToolbarItemUnderScreenPoint(Point screenPoint) { // 現在のマウス位置の下にあるツールについての情報を表示します ToolBase toolUnderPoint = this.ultraToolbarsManager1.ToolFromPoint(screenPoint); if (toolUnderPoint != null) Debug.WriteLine("The key of the tool under the point '" + screenPoint.ToString() + "' is '" + toolUnderPoint.Key + "'. The tool is of type '" + toolUnderPoint.GetType().ToString()); // 現在のマウス位置の下にあるツールバーについての情報を表示します UltraToolbar toolbarUnderPoint = this.ultraToolbarsManager1.ToolbarFromPoint(screenPoint); if (toolbarUnderPoint != null) Debug.WriteLine("The key of the tool under the point '" + screenPoint.ToString() + "' is '" + toolbarUnderPoint.Key + "'. It's current dock location is '" + toolbarUnderPoint.DockedPosition.ToString()); // 現在のマウス位置の下にある UIElement についての情報を表示します UIElement elementUnderPoint = this.ultraToolbarsManager1.UIElementFromPoint(screenPoint); if (elementUnderPoint != null) Debug.WriteLine("The key of the tool under the point '" + screenPoint.ToString() + "' is '" + elementUnderPoint.GetType().ToString()); }