DataGridDesigner.Initialize(IComponent) Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Menginisialisasi perancang dengan kontrol yang ditentukan DataGrid .
public:
override void Initialize(System::ComponentModel::IComponent ^ component);
public override void Initialize (System.ComponentModel.IComponent component);
override this.Initialize : System.ComponentModel.IComponent -> unit
Public Overrides Sub Initialize (component As IComponent)
Parameter
- component
- IComponent
Elemen kontrol sedang dirancang.
Contoh
Contoh kode berikut menunjukkan cara mengambil Initialize alih metode untuk memastikan bahwa perancang hanya diinisialisasi dengan instans SimpleDataGrid kelas .
Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk DataGridDesigner kelas .
' 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