N
Nick Head
I have a custom toolbar button defined in my manifest file:
<xsf:toolbar name="Form toolbar" caption="Form toolbar">
<xsf:button caption="test Button" name="btnTest"></xsf:button>
</xsf:toolbar>
How do I hook up a managed event handler for when this button is pressed? I know that button elements can have action atributes e.g.
<xsf:button
name="btnTest"
action="xCollection::insert" >
But how do I map that to an eventhandler in my C# class? I tried just running my project with the following event handler, but InfoPath just gave me an error:
"InfoPath cannot open the selected form because of an error in the form's code. The form template has an invalid event handler: OnBtnTestClick."
[InfoPathEventHandler(MatchPath="btnTest", EventType=InfoPathEventType.OnClick)]
public void OnBtnTestClick(DocReturnEvent e)
{
thisXDocument.UI.Alert("pressed!");
e.ReturnStatus = true;
}
Any ideas?
TIA
Nick
<xsf:toolbar name="Form toolbar" caption="Form toolbar">
<xsf:button caption="test Button" name="btnTest"></xsf:button>
</xsf:toolbar>
How do I hook up a managed event handler for when this button is pressed? I know that button elements can have action atributes e.g.
<xsf:button
name="btnTest"
action="xCollection::insert" >
But how do I map that to an eventhandler in my C# class? I tried just running my project with the following event handler, but InfoPath just gave me an error:
"InfoPath cannot open the selected form because of an error in the form's code. The form template has an invalid event handler: OnBtnTestClick."
[InfoPathEventHandler(MatchPath="btnTest", EventType=InfoPathEventType.OnClick)]
public void OnBtnTestClick(DocReturnEvent e)
{
thisXDocument.UI.Alert("pressed!");
e.ReturnStatus = true;
}
Any ideas?
TIA
Nick