See Also

UIElement Class  | UIElement Members

Language

Visual Basic

C#

Show All

point
Point
See Also Languages Infragistics2.Win.v7.2

GetAdjustableCursor Method

Infragistics.Win Namespace > UIElement Class : GetAdjustableCursor Method (UIElement)

The adjustable cursor is used by any element that can be moved or resized. Returning null means the element can not be adjusted by clicking on the passed in point.

[Visual Basic]
Public Overridable Function GetAdjustableCursor( _    ByVal point As Point _ ) As Cursor
[C#]
public virtual Cursor GetAdjustableCursor(    Point point );

Parameters

point
Point

Return Type

Cursor

Example

This sample hit tests an ultragrid for its Adjustable Elements.

[Visual Basic] 

     Imports System.Diagnostics
     Imports System.Collections
     Imports Infragistics.Win
     Imports System.Windows.Forms

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

            ' Fill the grid with array data.
        Dim list As New ArrayList()

        list.AddRange(New Object() {"One", "Two"})
        Me.UltraGrid1.DataSource = list

    End Sub

    Private Sub UltraGrid1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles UltraGrid1.MouseDown

        PrintAdjustableElementFromPt(New Point(e.X, e.Y))

    End Sub

    Private Sub PrintAdjustableElementFromPt(ByVal pt As Point)

            'Test for AdjustableElement under passed in point.
        Dim element As UIElement = Me.UltraGrid1.DisplayLayout.UIElement.AdjustableElementFromPoint(pt)

        If Not element Is Nothing Then

            Debug.WriteLine(element.GetType().ToString())

                  'If we have an AjustableElement, get its associated cursor.
            Dim cursor As Cursor = element.GetAdjustableCursor(pt)

            If (Not cursor Is Nothing) Then
                Debug.WriteLine("Cursor is adjustable")
            End If

            Debug.WriteLine("Not Adjustable")

        End If

    End Sub

[C#] 

 
      using System.Diagnostics; 
      using System.Collections; 
      using Infragistics.Win; 
      using System.Windows.Forms; 
 
 
        private void Form1_Load(object sender, System.EventArgs e) 
        { 
 
            // Fill the grid with array data. 
            ArrayList list = new ArrayList(); 
 
            list.AddRange(new object[] {"One","Two"}); 
            this.ultraGrid1.DataSource = list; 
 
        } 
 
        private void ultraGrid1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) 
        { 
 
            PrintAdjustableElementFromPt(new Point(e.X,e.Y)); 
 
        } 
 
        private void PrintAdjustableElementFromPt(Point pt) 
        { 
 
            // Test for AdjustableElement under passed in point. 
            UIElement element = this.ultraGrid1.DisplayLayout.UIElement.AdjustableElementFromPoint(pt); 
             
              
            if (null != element ) 
            { 
                Debug.WriteLine(element.GetType().ToString()); 
 
                // If we have an AjustableElement, get its associated cursor. 
                Cursor cursor = element.GetAdjustableCursor(pt); 
 
                if (null != cursor) 
                    Debug.WriteLine("Cursor is adjustable"); 
            } 
            else 
                Debug.WriteLine("Not Adjustable"); 
        }

See Also

UIElement Class  | UIElement Members

E-mail your feedback on this topic.

Opinion about our help? Take our survey.

Copyright © 1996-2007 Infragistics, Inc. All rights reserved.

Build Version: 7.2.20072.1063