Edit

Share via


Behavior Constructors

Definition

Initializes a new instance of the Behavior class.

Overloads

Behavior()

Initializes a new instance of the Behavior class.

Behavior(Boolean, BehaviorService)

Initializes a new instance of the Behavior class with the given BehaviorService.

Behavior()

Initializes a new instance of the Behavior class.

protected:
 Behavior();
protected Behavior ();
Protected Sub New ()

Examples

The following code example demonstrates how to initialize a new instance of the Behavior class. This code example is part of a larger example provided for the BehaviorService class.

public:
    DemoGlyph(BehaviorService^ behavior, Control^ control):
      Glyph(gcnew BehaviorServiceSample::DemoBehavior)
      {
          this->behavior = behavior;
          this->control = control;
      }
public MyGlyph(BehaviorService behaviorSvc, Control control) : 
    base(new MyBehavior())
{
    this.behaviorSvc = behaviorSvc;
    this.control = control;
}
Public Sub New(ByVal behaviorSvc As _
    System.Windows.Forms.Design.Behavior.BehaviorService, _
    ByVal control As Control)

    MyBase.New(New MyBehavior())
    Me.behaviorSvc = behaviorSvc
    Me.control = control
End Sub

See also

Applies to

Behavior(Boolean, BehaviorService)

Initializes a new instance of the Behavior class with the given BehaviorService.

protected:
 Behavior(bool callParentBehavior, System::Windows::Forms::Design::Behavior::BehaviorService ^ behaviorService);
protected Behavior (bool callParentBehavior, System.Windows.Forms.Design.Behavior.BehaviorService behaviorService);
protected Behavior (bool callParentBehavior, System.Windows.Forms.Design.Behavior.BehaviorService? behaviorService);
new System.Windows.Forms.Design.Behavior.Behavior : bool * System.Windows.Forms.Design.Behavior.BehaviorService -> System.Windows.Forms.Design.Behavior.Behavior
Protected Sub New (callParentBehavior As Boolean, behaviorService As BehaviorService)

Parameters

callParentBehavior
Boolean

true if the parent behavior should be called if it exists; otherwise, false.

behaviorService
BehaviorService

The BehaviorService to use.

Exceptions

callParentBehavior is true, and behaviorService is null.

Remarks

The parent behavior is the next behavior on the behavior stack maintained by the BehaviorService. If the callParentBehavior parameter is true, then the behaviorService parameter must not be null.

callParentBehavior indicates whether the base Behavior class should call the parent behavior, and then allow the BehaviorService select the correct parent behavior.

Applies to