'宣言 Public ReadOnly Property UIElement As UltraTextEditorUIElement
public UltraTextEditorUIElement UIElement {get;}
UIElement プロパティは、コントロール自体を表す UIElement への参照を返します。コントロールのすべての UI 要素は、コントロールの UIElement (ランタイムに限って使用可能) の子である UIElements として実装されます。
Imports Infragistics.Win Imports Infragistics.Win.UltraWinEditors Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim cursorIsOverImage As Boolean = Me.IsPointOverImage(New Point(10, 10)) End Sub Private Function IsPointOverImage(ByVal point As Point) As Boolean ' Use the control's UIElement property to get a reference to ' the UIElement that represents the control itself Dim mainElement As UIElement = Me.UltraTextEditor1.UIElement ' Try to locate an ImageUIElement if we can't, return false Dim imageUIElement As ImageUIElement = mainElement.GetDescendant(GetType(ImageUIElement)) If (imageUIElement Is Nothing) Then Return False ' If the specified point is within the bounds of the ' ImageUIElement, return true If (imageUIElement.PointInElement(point)) Then Return True Return False End Function
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinEditors; private void button1_Click(object sender, System.EventArgs e) { bool cursorIsOverImage = this.IsPointOverImage( new Point(10,10) ); } private bool IsPointOverImage( Point point ) { // Use the control's UIElement property to get a reference to // the UIElement that represents the control itself UIElement mainElement = this.ultraTextEditor1.UIElement; // Try to locate an ImageUIElement; if we can't, return false ImageUIElement imageUIElement = mainElement.GetDescendant( typeof(ImageUIElement) ) as ImageUIElement; if ( imageUIElement == null ) return false; // If the specified point is within the bounds of the // ImageUIElement, return true if ( imageUIElement.PointInElement( point ) ) return true; return false; }