HtmlWindow.Load HtmlWindow.Load HtmlWindow.Load HtmlWindow.Load Event

定義

ウィンドウのドキュメントとそのすべての要素の初期化が終了すると発生します。Occurs when the window's document and all of its elements have finished initializing.

public:
 event System::Windows::Forms::HtmlElementEventHandler ^ Load;
public event System.Windows.Forms.HtmlElementEventHandler Load;
member this.Load : System.Windows.Forms.HtmlElementEventHandler 
Public Custom Event Load As HtmlElementEventHandler 

次のコード例では、このメンバーの使用を示します。The following code example demonstrates the use of this member. 例では、イベント ハンドラーが発生するときに報告、Loadイベント。In the example, an event handler reports on the occurrence of the Load event. このレポートでは、イベントが発生してデバッグに役立つについて説明します。This report helps you to learn when the event occurs and can assist you in debugging. 複数のイベントまたは頻繁に発生するイベントを報告する、交換を検討MessageBox.ShowConsole.WriteLineまたはメッセージを複数行に追加TextBoxします。To report on multiple events or on events that occur frequently, consider replacing MessageBox.Show with Console.WriteLine or appending the message to a multiline TextBox.

コード例を実行する型のインスタンスを含むプロジェクトに貼り付けることHtmlWindowというHtmlWindow1します。To run the example code, paste it into a project that contains an instance of type HtmlWindow named HtmlWindow1. イベント ハンドラーに関連付けられていることを確認し、Loadイベント。Then ensure that the event handler is associated with the Load event.

private void HtmlWindow1_Load(Object sender, HtmlElementEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "MouseButtonsPressed", e.MouseButtonsPressed );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ClientMousePosition", e.ClientMousePosition );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "OffsetMousePosition", e.OffsetMousePosition );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "MousePosition", e.MousePosition );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "BubbleEvent", e.BubbleEvent );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "KeyPressedCode", e.KeyPressedCode );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "AltKeyPressed", e.AltKeyPressed );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "CtrlKeyPressed", e.CtrlKeyPressed );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ShiftKeyPressed", e.ShiftKeyPressed );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "EventType", e.EventType );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ReturnValue", e.ReturnValue );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "FromElement", e.FromElement );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ToElement", e.ToElement );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "Load Event" );
}
Private Sub HtmlWindow1_Load(sender as Object, e as HtmlElementEventArgs) _ 
     Handles HtmlWindow1.Load

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "MouseButtonsPressed", e.MouseButtonsPressed)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ClientMousePosition", e.ClientMousePosition)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "OffsetMousePosition", e.OffsetMousePosition)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "MousePosition", e.MousePosition)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "BubbleEvent", e.BubbleEvent)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "KeyPressedCode", e.KeyPressedCode)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "AltKeyPressed", e.AltKeyPressed)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "CtrlKeyPressed", e.CtrlKeyPressed)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ShiftKeyPressed", e.ShiftKeyPressed)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "EventType", e.EventType)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ReturnValue", e.ReturnValue)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "FromElement", e.FromElement)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ToElement", e.ToElement)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"Load Event")

End Sub

注釈

Loadイベントの動作と同様に、DocumentCompleted上のイベント、WebBrowserコントロール: 要素にアクセスする HTML ドキュメントの内部でも安全であることを通知します。The Load event works similarly to the DocumentCompleted event on the WebBrowser control: it signals that it is safe to access HTML elements inside of the document.

既定のアクションを取り消すことはできません、Loadイベント。You cannot cancel the default action for the Load event.

適用対象

こちらもご覧ください