Reputation: 125
In web browser of Visual C#, if the user moves the cursor on to the link, the cursor would be changed into a hand automatically.. I want to change this.. I want to make my program not to show hand if user moves the cursor on to a link in the web browser of my program.. I checked all the web browser properties in visual C# and I couldn't find any settings to do it.. Is it possible or not ?
If it is, how can I do it ?
Thanks !
Upvotes: 0
Views: 338
Reputation: 52942
You can do this by injecting a CSS rule into the browser control.
What you want to do is add the style/css property cursor:default
You can do this by injecting a style element into the head section:
HtmlElement headTag = webBrowser1.Document.GetElementsByTagName("head")[0];
HtmlElement styleEl = webBrowser1.Document.CreateElement("style");
IHTMLStyleElement element = (IHTMLStyleElement)styleEl.DomElement;
IHTMLStyleSheetElement styleSheet = element.styleSheet;
styleSheet.cssText = @"a { cursor: default }";
head.AppendChild(styleEl);
Upvotes: 1