Working with View Objects and Events

You can make changing views easier for users by adding buttons to execute the SwitchView(“ViewName”) method. The Rss2Events sample form has an All Sections button in the ItemsOnly view and an Items Only button in the AllSections view. If you have several views, it’s a good practice to inform users which view is active. Text in a layout table cell can accomplish this objective, but adding the view name to the form window’s title bar shows you how to take advantage of the OnSwitchView event and the Caption property.

To program the two view buttons and the two view windows’ Caption properties, follow these steps.

Add event handlers for view-related operations

1.
Open the Rss2Events.sln solution in your C:\Microsoft ...

Get Introducing Microsoft® Office InfoPath™ 2003 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.