Reputation: 11
I load HTML document in GeckoFX control. Hovering an HTML element (input, select & link) will highlight it with red color, moving mouse out will restore it's visual state.
One idea is to use OnPaint event and draw rectangle at mouse coordinate. But I do not know how to use this in C# with GeckoFX control.
Any ideas on how to achieve this or to highlight HTML element are welcome.
Thank you.
Upvotes: 1
Views: 709
Reputation: 4786
Not sure what kind of highlight you have in mind, but in any case you should be able to use Style for it.
For example, you can use DomMouseOver event of GeckoWebBrowser and in the event handler check if the element that the mouse is over is the element you want to highlight (by id, by tag name, by class name). If so, then maybe something like
theElement.SetAttribute("style", "background: #" + color);
would be sufficient?
Also another way to do it would be to inject html / javascript or css to the page you are browsing and handling it from that side.
I do both of these things, though I prefer the first one because it's easier to manage from c# code...
Upvotes: 1