I started to look at Infopath long time ago and was waiting for that solution. I was really surprised to see Infopath with something else then .NET to wrtie code for it. That’s over. :-)

Since I implemented a tool to write the article on my web site Tech Head Brothers based on Word 2003 and Visual Studio Toolkit I was waiting the toolkit for Infopath to be able to have a form to post News that will use WSE to handle secured connection to my site.
In this new version when you add a button you will get a dialog with a button “Edit from code” and when you click on it your get back to Visual Studio that already added a handler for you:

// The following function handler is created by Microsoft Office InfoPath. Do not

// modify the type or number of arguments.

[InfoPathEventHandler(MatchPath=”CTRL4_5”, EventType=InfoPathEventType.OnClick)]

public void CTRL4_5_OnClick(DocActionEvent e)

{

// Write your code here.

}

Thats really really cool.