C# code samples
First off, let me say that this is one of the better computer-related books I've read. The author did a great job explaining things in a comfortable, conversational tone, as opposed to high-handed and pretentious as is more common.
I'm curious as to how to perform Chapter 14's Context Sensitive Help Try It Out (on page 243) in C#. The closest I could come for the OnContextChange event was:
[InfoPathEventHandler(EventType=InfoPathEventType.O nContextChange)]
public void OnContextChange(DocContextChangeEvent e)
{
string strHelp = null;
if (e.Type == "ContextNode")
{
HTMLTaskPane objTP = (HTMLTaskPane)thisXDocument.View.Window.TaskPanes[0];
HTMLDocument objDoc = (HTMLDocument)objTP.HTMLDocument;
if(objTP != null && objTP.HTMLDocument.readyState == "complete")
{
if(strHelp != null)
objDoc.all.item(strHelp, 0).
objDoc.all.item(e.Context.nodeName, 0).style.display = "";
strHelp = e.Context.nodeName;
}
return;
}
}
I'm getting build errors for the "objDoc.all.item(e.Context.nodeName, 0).style" line, stating that "'object' does not contain a definition for 'style'"
Any help you can provide is greatly appreciated.
-DC Ross
|