I have a .net Windows forms project that includes the System.Windows.forms.WebBrowser control to allow the user to do some editing of HTML content. When this control is in edit mode Elements such as div or span can be drag-and-drop edited, but selecting an element and typing Delete does nothing.
I have seen a few posts that talk about making this work in C++ but they are not very detailed. Example http://social.msdn.microsoft.com/Forums/en-US/ieextensiondevelopment/thread/1f485dc6-e8b2-4da7-983f-ca431f96021f/
This next post talks about using a function called TranslateAccelerator method to solve similar problems in MFC projects. http://vbyte.com/iReader/Reader.asp?ISBN=0735607818&URI=/HTML/chaab.htm
Does anyone have a suggestion on how to make the delete key work in C# or VB for a windows forms project?
Here is my code to create the WebBrowser content:
WebBrowser1.Navigate("about:blank") ' Initializes the control
Application.DoEvents
WebBrowser1.Document.OpenNew(False).Write("<html><body><span>Project Title</span><input type='text' value='' /></body></html>")
WebBrowser1.ActiveXInstance.Document.DesignMode = "On" ' Option Explicit must be set to off
WebBrowser1.Document.Body.SetAttribute("contenteditable", "true")
Thanks