System.Windows.Automation.AutomationElement.GetCurrentPropertyValue C# (CSharp) Method

GetCurrentPropertyValue() public method

public GetCurrentPropertyValue ( AutomationProperty property ) : object
property AutomationProperty
return object
        public object GetCurrentPropertyValue(AutomationProperty property)
        {
            return this.GetCurrentPropertyValue(property, false);
        }

Same methods

AutomationElement::GetCurrentPropertyValue ( AutomationProperty property, bool ignoreDefaultValue ) : object

Usage Example

Example #1
0
 // CONSIDER: This will run on our automation thread
 //           Should be OK to call MoveWindow from there - it just posts messages to the window.
 void TestMoveWindow(AutomationElement listWindow, int xOffset, int yOffset)
 {
     var hwndList = (IntPtr)(int)(listWindow.GetCurrentPropertyValue(AutomationElement.NativeWindowHandleProperty));
     var listRect = (Rect)listWindow.GetCurrentPropertyValue(AutomationElement.BoundingRectangleProperty);
     Debug.Print("Moving from {0}, {1}", listRect.X, listRect.Y);
     Win32Helper.MoveWindow(hwndList, (int)listRect.X - xOffset, (int)listRect.Y - yOffset, (int)listRect.Width, 2 * (int)listRect.Height, true);
 }
All Usage Examples Of System.Windows.Automation.AutomationElement::GetCurrentPropertyValue