I'm using the .NET WebBrowser control in a WinForms application to implement a very basic e-mail template editor.
I've set it in edit mode by this code:
wbEmailText.Navigate( "about:blank" );
( (HTMLDocument)wbEmailText.Document.DomDocument ).designMode = "On";
So the user can modify the WebBrowser content. Now I need to detect when the user modifies the content 'cause I have to validate it. I've tried to use some WebBrowser's events like DocumentCompleted, Navigated, etc. but no-one of these worked. Could someone give me advice, please? Thanks in advance!
I did have some working, really world code but that project is about 5 years old and I've since left the company. I've trawled my back-ups but can't find it so I am trying to work from memory and give you some pointers.
There are lots of events you can catch and then hook into to find out whether a change has been made. A list of the events can be found here: http://msdn.microsoft.com/en-us/library/ms535862(v=vs.85).aspx
What we did was catch key events (they're typing) and click events (they've moved focus or dragged / dropped etc) and handled that.
Some example code, note a few bits are pseudo code because I couldn't remember off the top of my head the actual code.