I'm working on a third party program called "Encompass 360" and I'm very confined to the limits of their SDK. With that said, they make use of MSHTML to draw up forms (hence why I can't utilize HAP.) This has been a very frustrating process.
I want to create my own form that is more dynamic than what they offer from their "form builder".
The definition they provide for us to use it:
public void AttachToDocument(HTMLDocument document, FormOptions option)
I'm trying this:
HTMLDocument htpanel = pnlHTML.HTMLElement.document as HTMLDocument;
htpanel.open();
htpanel.createElement("Form");
htpanel.createTextNode("Just some text");
htpanel.createAttribute("P");
htpanel.write(new object[] { "<P>Please work.</P>" });
htpanel.close();
htpanel.body.innerHTML = ("<SCRIPT type=\"text/javascript\">Alert(\"HI\");</SCRIPT>");
try
{
htpanel.body.outerHTML = ("<BODY id=pnlHTML1 contentEditable=false style=\"BORDER-TOP: 0px inset; BORDER-RIGHT: 0px inset; BORDER-BOTTOM: 0px inset; BORDER-LEFT: 0px inset; VISIBILITY: inherit\" controlType=\"Class1\"></BODY>");
}catch(Exception ex)
{
wf.MessageBox.Show(ex.Message.ToString());
}
htpanel.bgColor = Color.Black;
this.Form.AttachToDocument(htpanel, FormOptions.None);
With the code above, "htpanel.write()" causes a COMException with the error of "Type Mismatch". I've tried many different ways I've found searching and can't get past this.
Can someone please point me in the right direction?