Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > Visual Basic code > Modeling Visual Basic code in a model > Modeling a Visual Basic event handler in a model (Visual Basic code)
  
Modeling a Visual Basic event handler in a model (Visual Basic code)
A Visual Basic event handler is modeled through a Modeler Operation.
To model a Visual Basic event handler in a model:
1. In Modeler, right-click the Class or Interface that models the element that is to own the event handler, point to New, and then click Operation.
2. Type the name of the event hander, and then press the Enter key.
3. Right-click the Operation, point to Links > Stereotypes, and then click VB Operation.
4. Right-click the Operation, point to Links > Stereotypes, and then click VB EvHdlr.
5. Open the Operation's property pages.
6. On the Body tab, type the event handler code.
7. If you want to generate a handles clause for the event handler: on the VB EvHdlr tab, set the value of the VB EvHandlers tag definition to the handles clause you want to generate.
8. If you want to generate an argument list for the event handler: on the VB EvHdlrtab, set the value of the VB EvhdlrArgstag definition to the argument list you want to generate.
9. If you want to generate a prefix for the event handler name: on the VB EvHdlrtab, set the value of the VB EvPrefix tag definition to the prefix you want to generate.
10. Set the values of standard properties and Tag Definitions (applied by the «VB Operation» stereotype) as required.
For more information about how ACS generates the values of an Operation's standard properties and Tag Definitions, see the related link below.
For information, see Setting a tagged value for an applied tag definition.