ControlAdapter.OnInit メソッド
アセンブリ: System.Web (system.web.dll 内)

Dim e As EventArgs Me.OnInit(e)

Control オブジェクトに割り当てられているアダプタがあり、OnInit メソッドがオーバーライドされている場合は、Control.OnInit メソッドではなく、オーバーライド メソッドが呼び出されます。
コントロールの有効期間の Initialize の段階でターゲット固有の処理を実行する場合は、OnInit をオーバーライドします。通常、これらは、コントロールの作成時に実行される機能です。
継承時の注意 ControlAdapter クラスから継承し、アダプタが OnInit メソッドをオーバーライドする場合、アダプタは、基本クラスの対応するメソッドを呼び出す必要があります。呼び出されたメソッドが、Control.OnInit メソッドを呼び出します。Control.OnInit メソッドが呼び出されなかった場合、Control.Init イベントは発生しません。
次のコード例では、ControlAdapter クラスからカスタム コントロール アダプタを派生させています。その後、OnInit メソッドをオーバーライドして、関連付けられたコントロールにプロパティを設定し、基本メソッドを呼び出してコントロールの初期化を完了しています。
Imports System Imports System.Web.UI Imports System.Web.UI.Adapters Public Class CustomControlAdapter Inherits ControlAdapter ' Override the ControlAdapter default OnInit implementation. Protected Overrides Sub OnInit(ByVal e As EventArgs) ' Make the control invisible. Control.Visible = False ' Call the base method, which calls OnInit of the control, ' which raises the control Init event. MyBase.OnInit(e) End Sub 'OnInit End Class 'CustomControlAdapter
using System; using System.Web.UI; using System.Web.UI.Adapters; public class CustomControlAdapter : ControlAdapter { // Override the ControlAdapter default OnInit implementation. protected override void OnInit (EventArgs e) { // Make the control invisible. Control.Visible = false; // Call the base method, which calls OnInit of the control, // which raises the control Init event. base.OnInit(e); } }
#using <System.Web.dll> #using <System.dll> using namespace System; using namespace System::Web::UI; using namespace System::Web::UI::Adapters; public ref class CustomControlAdapter: public ControlAdapter { // Override the ControlAdapter default OnInit implementation. protected: virtual void OnInit( EventArgs^ e ) override { // Make the control invisible. Control->Visible = false; // Call the base method, which calls OnInit of the control, // which raises the control Init event. ControlAdapter::OnInit( e ); } };

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ControlAdapter.OnInit メソッド
アセンブリ: System.Web.Mobile (system.web.mobile.dll 内)


このメソッドをオーバーライドして、デバイス固有のプロパティを設定できます。継承クラスは、このメソッドをオーバーライドすることによって、他のタスクを実行できます。このメソッドが継承クラスでオーバーライドされる場合は、基本の実装を呼び出す必要があります。

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からControlAdapter.OnInitを検索する場合は、下記のリンクをクリックしてください。

- ControlAdapter.OnInitのページへのリンク