Let's work on a sample form and use some of the events available in Microsoft Office InfoPath 2007. Let's start by creating a company expense report form, and implementing the events for the validation of the user interface.
We are using most of the events available in InfoPath 2007 in the expense report for some of the user interface validation.
2. On the File menu, click on New Project.
3. In the New Project dialog box, expand Visual C# project types.
4. Select New project. Under Office select 2007, and select InfoPath 2007 Form template. Name the project as per your requirements.
5. The Design Template dialog box is displayed. This is where you choose the appropriate template for your design. In this example, we have selected the Expense Report template.
6. Add the following code into the
formcode.cs
file.
public partial class FormCode { public void InternalStartup() { EventManager.FormEvents.Loading...