WebBrowserNavigatingEventArgsとは? わかりやすく解説

WebBrowserNavigatingEventArgs クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

WebBrowser.Navigating イベントデータ提供します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Class WebBrowserNavigatingEventArgs
    Inherits CancelEventArgs
Dim instance As WebBrowserNavigatingEventArgs
public class WebBrowserNavigatingEventArgs
 : CancelEventArgs
public ref class WebBrowserNavigatingEventArgs
 : public CancelEventArgs
public class WebBrowserNavigatingEventArgs
 extends CancelEventArgs
public class WebBrowserNavigatingEventArgs
 extends CancelEventArgs
解説解説
使用例使用例

WebBrowser.Navigating イベントハンドラ使用してWeb ページフォーム入力されていない場合ナビゲーションキャンセルする方法次のコード例示します。WebBrowser.Document プロパティ使用してフォーム入力フィールドに値が含まれているかどうか判別します。この例は、フォームwebBrowser1 という WebBrowser コントロール存在することを前提にしています。

Private Sub Form1_Load(ByVal
 sender As Object, ByVal
 e As EventArgs) _
    Handles Me.Load

    webBrowser1.DocumentText = _
        "<html><body>Please enter your name:<br/>"
 & _
        "<input type='text' name='userName'/><br/>"
 & _
        "<a href='http://www.microsoft.com'>continue</a>"
 & _
        "</body></html>"

End Sub

Private Sub webBrowser1_Navigating( _
    ByVal sender As Object,
 ByVal e As WebBrowserNavigatingEventArgs)
 _
    Handles webBrowser1.Navigating

    Dim document As System.Windows.Forms.HtmlDocument
 = _
        webBrowser1.Document
    If document IsNot Nothing And
 _
        document.All("userName") IsNot Nothing
 And _
        String.IsNullOrEmpty( _
        document.All("userName").GetAttribute("value"))
 Then

        e.Cancel = True
        MsgBox("You must enter your name before you can navigate
 to " & _
            e.Url.ToString())
    End If

End Sub
private void Form1_Load(object sender, EventArgs
 e)
{
    webBrowser1.DocumentText =
        "<html><body>Please enter your name:<br/>" +
        "<input type='text' name='userName'/><br/>" +
        "<a href='http://www.microsoft.com'>continue</a>"
 +
        "</body></html>";
    webBrowser1.Navigating += 
        new WebBrowserNavigatingEventHandler(webBrowser1_Navigating);
}

private void webBrowser1_Navigating(object
 sender, 
    WebBrowserNavigatingEventArgs e)
{
    System.Windows.Forms.HtmlDocument document =
        this.webBrowser1.Document;

    if (document != null && document.All["userName"]
 != null && 
        String.IsNullOrEmpty(
        document.All["userName"].GetAttribute("value")))
    {
        e.Cancel = true;
        System.Windows.Forms.MessageBox.Show(
            "You must enter your name before you can navigate to " +
            e.Url.ToString());
    }
}
継承階層継承階層
System.Object
   System.EventArgs
     System.ComponentModel.CancelEventArgs
      System.Windows.Forms.WebBrowserNavigatingEventArgs
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebBrowserNavigatingEventArgs メンバ
System.Windows.Forms 名前空間
CancelEventArgs.Cancel
TargetFrameName
Url
WebBrowser クラス
WebBrowser.Navigating イベント

WebBrowserNavigatingEventArgs コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

WebBrowserNavigatingEventArgs クラス新しインスタンス初期化します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Sub New ( _
    url As Uri, _
    targetFrameName As String _
)
Dim url As Uri
Dim targetFrameName As String

Dim instance As New WebBrowserNavigatingEventArgs(url,
 targetFrameName)
public WebBrowserNavigatingEventArgs (
    Uri url,
    string targetFrameName
)
public:
WebBrowserNavigatingEventArgs (
    Uri^ url, 
    String^ targetFrameName
)
public WebBrowserNavigatingEventArgs (
    Uri url, 
    String targetFrameName
)
public function WebBrowserNavigatingEventArgs
 (
    url : Uri, 
    targetFrameName : String
)

パラメータ

url

WebBrowser コントロール移動ドキュメントの場所を表す Uri

targetFrameName

新しドキュメント読み込まれWeb ページ フレームの名前。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebBrowserNavigatingEventArgs クラス
WebBrowserNavigatingEventArgs メンバ
System.Windows.Forms 名前空間
WebBrowser クラス
WebBrowser.Navigating イベント

WebBrowserNavigatingEventArgs プロパティ


パブリック プロパティパブリック プロパティ

参照参照

関連項目

WebBrowserNavigatingEventArgs クラス
System.Windows.Forms 名前空間
CancelEventArgs.Cancel
TargetFrameName
Url
WebBrowser クラス
WebBrowser.Navigating イベント

WebBrowserNavigatingEventArgs メソッド


WebBrowserNavigatingEventArgs メンバ

WebBrowser.Navigating イベントデータ提供します

WebBrowserNavigatingEventArgs データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド WebBrowserNavigatingEventArgs WebBrowserNavigatingEventArgs クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

WebBrowserNavigatingEventArgs クラス
System.Windows.Forms 名前空間
CancelEventArgs.Cancel
TargetFrameName
Url
WebBrowser クラス
WebBrowser.Navigating イベント


このページでは「.NET Framework クラス ライブラリ リファレンス」からWebBrowserNavigatingEventArgsを検索した結果を表示しています。
Weblioに収録されているすべての辞書からWebBrowserNavigatingEventArgsを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からWebBrowserNavigatingEventArgs を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「WebBrowserNavigatingEventArgs」の関連用語

WebBrowserNavigatingEventArgsのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



WebBrowserNavigatingEventArgsのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS