Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Control Constructor
Collapse the table of content
Expand the table of content

Control Constructor

Initializes a new instance of the Control class.

[Visual Basic]
Public Sub New()
[C#]
public Control();
[C++]
public: Control();
[JScript]
public function Control();

Example

[Visual Basic, C#, C++] The following example demonstrates using the Control constructor to instantiate a custom server control, MyControl.

[Visual Basic] 
' Create an instance of 'MyControl' class.
Protected myControl As New MyControl()

[C#] 
// This example creates an instance of the 'MyControl' class.
protected MyControl myControl = new MyControl();

[C++] 
// This example creates an instance of the 'MyControl' class.
MyControl* myControl = new MyControl();

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ 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

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

Show:
© 2015 Microsoft