Hi,
I know, of course, that visual components have the .ElementHandle routine to get the corresponding HTML DOM element, but is there a way to do the reverse, i.e. use the DOM element to get the underlying TComponent (or TWebCustomControl etc)?
Hi,
I know, of course, that visual components have the .ElementHandle routine to get the corresponding HTML DOM element, but is there a way to do the reverse, i.e. use the DOM element to get the underlying TComponent (or TWebCustomControl etc)?
That is for the DOM element that represents a TWebCustomControl or just any DOM element?
To find if a TWebCustomControl is connected to a DOM element in a form, you could loop in the form's Controls list and check if TWebCustomControl.ElementHandle = DOMHandle to find the TWebCustomControl.
Hi Bruno,
Thanks for the reply.
Yes, I was specifically thinking about TWebCustomControl.
The method you have shown me is the way I'm currently doing it; I was just wondering if there was a quicker way to do it (e.g. a ComponentHandle property), but it's not an issue.
Thanks!