Notification.OnResponseSubmitted メソッド
アセンブリ: Microsoft.WindowsCE.Forms (microsoft.windowsce.forms.dll 内)

Dim e As ResponseSubmittedEventArgs Me.OnResponseSubmitted(e)
- e

ResponseSubmitted イベントは、メッセージ バルーンがユーザー入力によって消された場合、または InitialDuration に設定した時間が経過した場合に発生します。Response プロパティには、HTML フォームの結果、またはユーザーがクリックしたボタンまたはリンクの名前が含まれた文字列が含まれます。この文字列を解析し、値がアプリケーションに適しているかどうかを確認できます。
イベントが発生すると、デリゲートを使用してイベント ハンドラが呼び出されます。詳細については、「イベントの発生」を参照してください。
OnResponseSubmitted メソッドを使用すると、デリゲートを結び付けずに、派生クラスでイベントを処理することもできます。派生クラスでイベントを処理する場合は、この手法をお勧めします。
継承時の注意 派生クラスで OnResponseSubmitted をオーバーライドする場合は、登録されているデリゲートがイベントを受け取ることができるように、基本クラスの OnResponseSubmitted メソッドを必ず呼び出してください。
HTML フォームで選択した値、およびメッセージ バルーンの他の要素の名前の Response プロパティを解析するコード例を次に示します。このコード例は、Notification クラスのトピックで取り上げているコード例の一部分です。
' When a ResponseSubmitted event occurs, this event handler ' parses the response to determine values in the HTML form. Private Sub OnResponseSubmitted(obj As Object, _ resevent As ResponseSubmittedEventArgs) Handles Notification1.ResponseSubmitted ' Use a StringBuilder to create a log of the response. Dim LogResponse As New StringBuilder() ' If the response contains the name specified for the action value ' of the HTML form, in this case "notify," get the value of the ' selected option from the SELECT list. An example of the ' response string would be notify?lstbx=0. If resevent.Response.Substring(0, 6) = "notify" Then Dim choice As Integer = Convert.ToInt32(resevent.Response.Substring(13, 1)) Select Case choice Case 0 LogResponse.Equals("submit") Case 1 LogResponse.Equals("opt 1") Case 2 LogResponse.Equals("opt 2") Case 3 LogResponse.Equals("opt 3") Case 4 LogResponse.Equals("opt 4") End Select ' If the checkbox in the form is checked, the response ' string could be as follows: notify?lstbx=0chkbx=on ' You can determine whether the check box is selected ' by checking whether the response ends with "on". If resevent.Response.EndsWith("on") Then LogResponse.Equals("checkbox") End If ' If the user clicked the settings link, ' log the response. This example could display ' a dialog box by activating another form. ElseIf resevent.Response = "settings" Then ' Display a settings dialog by activating ' a form named 'Settings': ' Settings.Activate LogResponse.Equals("Postponed by clicking link") ' The user needs to respond to the notification ' after checking the settings, so set the ' InitialDuration and Visible properties so ' that the icon appears in the title bar. Notification1.InitialDuration = 0 Notification1.Visible = True End If ' Display the response on the status bar. StatusBar1.Text = LogResponse.ToString() + " HTML: " + resevent.Response.ToString() End Sub
// When a ResponseSubmitted event occurs, this event handler // parses the response to determine values in the HTML form. private void OnResponseSubmitted(object obj, ResponseSubmittedEventArgs resevent) { // Use a StringBuilder to create a log of the response. StringBuilder LogResponse = new StringBuilder(); // If the response contains the name specified for the action value // of the HTML form, in this case "notify," get the value of the // selected option from the SELECT list. An example of the // response string would be notify?lstbx=0. if (resevent.Response.Substring(0, 6) == "notify") { int choice = Convert.ToInt32(resevent.Response.Substring(13, 1)); switch (choice) { case 0: LogResponse.Equals("submit"); break; case 1: LogResponse.Equals("opt 1"); break; case 2: LogResponse.Equals("opt 2"); break; case 3: LogResponse.Equals("opt 3"); break; case 4: LogResponse.Equals("opt 4"); break; } // If the checkbox in the form is checked, the response // string could be as follows: notify?lstbx=0chkbx=on // You can determine whether the check box is selected // by checking whether the response ends with "on". if (resevent.Response.EndsWith("on")) LogResponse.Equals("checkbox"); } // If the user clicked the settings link, // log the response. This example could display // a dialog box by activating another form. else if (resevent.Response == "settings") { // Display a settings dialog by activating // a form named 'Settings': // Settings.Activate LogResponse.Equals("Postponed by clicking link"); // The user needs to respond to the notification // after checking the settings, so set the // InitialDuration and Visible properties so // that the icon appears in the title bar. notification1.InitialDuration = 0; notification1.Visible = true; } // Display the response on the status bar. statusBar1.Text = LogResponse.ToString() + " HTML: " + resevent.Response.ToString(); }




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

- Notification.OnResponseSubmitted メソッドのページへのリンク