Hi I am trying to get the screen rectangle of a wpf button so that i can highlight it.
I use this to achieve the same:
AutomationPeer theBtnPeer = createPeerForElement(btn); Rect rect = theBtnPeer.GetBoundingScreenRectangle();
This works fine and give me the right rectangle.
However.. if the button is not currently visible then I invoke the BringIntoView() on this btn which successfully brings this button into view however when I call the GetBoundingSCreenRectangle() on it again . it gives me the same old value that was there before I invoked BringIntoView().
How do I get the new bounding rectangle of this button?
Thanks