AddHandler(UIElement,String,Delegate) Method
Adds an event handler for a non-routed event.
To add a handler for a routed event, use AddHandler(UIElement,RoutedEvent,Delegate). To add a handler for a non-routed event, use AddHandler(UIElement,String,Delegate). Check the event documentation in MSDN to determine whether it is routed or not.
Handlers added with this method are released by the UFT infrastructure.
| Visual Basic (Declaration) | |
|---|---|
Overloads Overridable Function AddHandler( _ ByVal src As UIElement, _ ByVal name As String, _ ByVal h As Delegate _ ) As Boolean  | |
Parameters
- src
 - The control on which to add the event handler. This is generally the IUtilityObject.ApplicationObject but may be a child control or any other control.
 - name
 The name of the event to handle, for example "SelectedDatesChanged" for the SelectedDatesChanged event on a calendar.
- h
 - The event handler.
 
| C# | Copy Code | 
|---|---|
private EventHandler<SelectionChangedEventArgs> _hSelectedDatesChanged;    | |

                                                        
                                                        
                                                        
                                                        
                                                        
                                                            
                                                            
                                        
                                        
                                        
                                        