DataGridDesigner.Initialize(IComponent) 方法   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
用指定的 DataGrid 控件初始化设计器。
public:
 override void Initialize(System::ComponentModel::IComponent ^ component);public override void Initialize (System.ComponentModel.IComponent component);override this.Initialize : System.ComponentModel.IComponent -> unitPublic Overrides Sub Initialize (component As IComponent)参数
- component
- IComponent
正在设计的控件元素。
示例
下面的代码示例演示如何重写 Initialize 方法,以确保设计器仅使用 类的 SimpleDataGrid 实例进行初始化。
此代码示例是为 DataGridDesigner 类提供的一个更大示例的一部分。
' Override the Initialize method to ensure that
' only an instance of the SimpleDataList class is
' used by this designer class.
Public Overrides Sub Initialize(ByVal component As IComponent)
    simpleList = CType(component, SimpleDataList)
    If IsNothing(simpleList) Then
        Throw New ArgumentException("Must be a SimpleDataList.", "component")
    End If
    MyBase.Initialize(component)
End Sub