Control Class Home
This page is specific to:Microsoft Version:3.03.5Silverlight 34.0
.NET Framework Class Library for Silverlight
Control Class

Represents the base class for UI elements that use a ControlTemplate to define their appearance.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
Syntax

'Usage

Dim instance As Control

'Declaration

Public MustInherit Class Control _
    Inherits FrameworkElement
Remarks

The Control class is the base class for many of the controls you add to an application. The Control class defines very little behavior; while it is possible to add a Control to your application, it is far more common to add a control that inherits from Control, such as a Button or ListBox.

The Template property, which is a ControlTemplate, specifies the appearance of the Control. Many of the controls that ship with Silverlight use a ControlTemplate and inherit from Control. If you want to change the appearance of a control but retain its functionality, you should consider creating a new ControlTemplate instead of creating a new class. For more information, see Customizing the Appearance of an Existing Control by Using a ControlTemplate.

Control has a derived class UserControl that is the intended base class quickly creating controls. Although the UserControl inherits the template property from the Control class, you cannot apply a ControlTemplate to a UserControl. To create a control that uses a ControlTemplate, see Creating a New Control by Creating a ControlTemplate.

If you want to create a control with custom behavior as well as allow others to customize its appearance, your control can inherit from the Control class and define a ControlTemplate. If you want to extend the behavior of an existing control, you can inherit from a class that inherits from Control.

Inheritance Hierarchy

System..::.Object
  System.Windows..::.DependencyObject
    System.Windows..::.UIElement
      System.Windows..::.FrameworkElement
        System.Windows.Controls..::.Control
          System.Windows.Controls..::.AutoCompleteBox
          System.Windows.Controls..::.Calendar
          System.Windows.Controls..::.ContentControl
          System.Windows.Controls..::.DataGrid
          System.Windows.Controls..::.DataGridRow
          System.Windows.Controls..::.DataGridRowGroupHeader
          System.Windows.Controls..::.DataPager
          System.Windows.Controls..::.DatePicker
          System.Windows.Controls..::.DescriptionViewer
          System.Windows.Controls..::.GridSplitter
          System.Windows.Controls..::.ItemsControl
          System.Windows.Controls..::.PasswordBox
          System.Windows.Controls.Primitives..::.CalendarItem
          System.Windows.Controls.Primitives..::.RangeBase
          System.Windows.Controls.Primitives..::.Thumb
          System.Windows.Controls..::.TextBox
          System.Windows.Controls..::.UserControl
          System.Windows.Controls..::.ValidationSummary
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View