This documentation is archived and is not being maintained.

ControlBuilder.AppendSubBuilder Method

Adds builders to the ControlBuilder object for any child controls that belong to the container control.

[Visual Basic]
Public Overridable Sub AppendSubBuilder( _
   ByVal subBuilder As ControlBuilder _
)
[C#]
public virtual void AppendSubBuilder(
 ControlBuilder subBuilder
);
[C++]
public: virtual void AppendSubBuilder(
 ControlBuilder* subBuilder
);
[JScript]
public function AppendSubBuilder(
   subBuilder : ControlBuilder
);

Parameters

subBuilder
The ControlBuilder object assigned to the child control.

Example

[Visual Basic] The following example overrides the AppendSubBuilder method to throw an Exception if the control this control builder is applied to tries to include controls in its instance of ControlCollection class.

[Visual Basic] 
' Override the AppendSubBuilder method to throw an
' exception if the class it is applied to attempts
' to include child controls. 
Overrides Public Sub AppendSubBuilder(ByVal subBuilder As ControlBuilder)
   Throw New Exception( _
      "A custom label control cannot contain other objects.")
End Sub

[C#, C++, JScript] No example is available for C#, C++, or JScript. To view a Visual Basic example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

ControlBuilder Class | ControlBuilder Members | System.Web.UI Namespace | ControlBuilder

Show: