Board index » cppbuilder » Is there a way to determine if an HTML element is currently visible in TCPPWebBrowser control.
Is there a way to determine if an HTML element is currently visible in TCPPWebBrowser control.
2005-10-16 12:58:29 PM
Actually this isn't so much TCPPWebBrowser question, but a MSHTML question.
I need to be able to determine whether an HTML element is currently visible
within the TCPPWebBrowser window. I'm writing code which will use a
TCPPWebBrowser control to simulate a listbox. As I press the UP/DOWN arrows
on the keyboard, a colored retangle will move up or down the screen to the
next object of interest in the HTML document.
All this is working fine, but I'm having to force a "scrollIntoView()" as an
object gets hilited. Visually this is confusing, because an element that is
clearly on screen suddenly moves to the top(or bottom) of the window. I'd
prefer to only call scrollIntoview() if an object isn't currently visible.
I'm able to calculate the document relative postions of each element I want
to hilite. The only values I'm missing are the demensions of the Browser
window(less any defined margins) and the area within the document that the
browser window represents. Are these values available? I'm at a loss on
how to get them.