Bewerken

Delen via


UIControl.AddTarget Method

Definition

Overloads

AddTarget(EventHandler, UIControlEvent)

Adds an event handler for the specified set of events.

AddTarget(NSObject, Selector, UIControlEvent)

Adds a target and control event(s) to this UIControl's internal dispatch table.

AddTarget(EventHandler, UIControlEvent)

Adds an event handler for the specified set of events.

public void AddTarget (EventHandler notification, UIKit.UIControlEvent events);
member this.AddTarget : EventHandler * UIKit.UIControlEvent -> unit

Parameters

notification
EventHandler

EventHandler to invoke.

events
UIControlEvent

Event mask that will trigger the event to be invoked.

Remarks

The notification handler will be invoked when the control receives any of the events listed in the events mask. The

Applies to

AddTarget(NSObject, Selector, UIControlEvent)

Adds a target and control event(s) to this UIControl's internal dispatch table.

[Foundation.Export("addTarget:action:forControlEvents:")]
public virtual void AddTarget (Foundation.NSObject target, ObjCRuntime.Selector sel, UIKit.UIControlEvent events);
abstract member AddTarget : Foundation.NSObject * ObjCRuntime.Selector * UIKit.UIControlEvent -> unit
override this.AddTarget : Foundation.NSObject * ObjCRuntime.Selector * UIKit.UIControlEvent -> unit

Parameters

target
NSObject

The target object, or null the responder chain is scanned for an object that responds to the specified selector.

This parameter can be null.

sel
Selector

The action to look for

Attributes

Applies to