Share via


ResponseSubmittedEventArgs.Response-Eigenschaft

Dieser Dokumentation für die Vorschau nur ist und in späteren Versionen geändert. Leere Themen wurden als Platzhalter eingefügt.]

Ruft eine Zeichenfolge mit den Namen der ausgewählten Verknüpfung oder Schaltfläche oder der Ergebnisse eines Formulars im Text der Sprechblase eingebettet ab.

Namespace:  Microsoft.WindowsCE.Forms
Assembly:  Microsoft.WindowsCE.Forms (in Microsoft.WindowsCE.Forms.dll)

Syntax

'Declaration
Public ReadOnly Property Response As String
    Get
'Usage
Dim instance As ResponseSubmittedEventArgs
Dim value As String

value = instance.Response
public string Response { get; }
public:
property String^ Response {
    String^ get ();
}
member Response : string

Eigenschaftswert

Typ: System.String
Ein Zeichenfolgenwert.

Hinweise

In der folgende Tabelle beschreibt mögliche Werte für diese Eigenschaft und die HTML-Elemente, die Sie erstellen können.

Element

HTML-Beispiel

Antwortwert

Name der Verknüpfung

<a href="helplink">Help</a>

HelpLink

Name einer Schaltfläche

<input type=button name=OKbutton value="OK">

OKbutton

HTML-Formularergebnisse

<form method=\"GET\" action=notify>

Aktion = benachrichtigen

Beachten Sie, dass cmd:#verwenden, wobei # eine ganze Zahl ist wie der Name für ein HTML-Element verhindert, dass das ResponseSubmitted-Ereignis ausgelöst wird.Der Bezeichner cmd:2 führt eine spezielle Funktion: das Benachrichtigungssymbol in der Titelleiste, wodurch es geeignet für Schaltflächen Abbrechen angezeigt.

Beispiele

Im folgenden Codebeispiel werden der Antwortzeichenfolge um festzustellen, welche Elemente analysiert den Benutzer in einer Sprechblase ausgewählt.Dieses Codebeispiel ist Teil eines umfangreicheren Beispiels für die Notification-Klasse bereitgestellt wird.

' When a ResponseSubmitted event occurs, this event handler' parses the response to determine values in the HTML form.PrivateSub OnResponseSubmitted(obj AsObject, _ 
   resevent As ResponseSubmittedEventArgs) Handles Notification1.ResponseSubmitted

   ' Use a StringBuilder to create a log of the response.Dim LogResponse AsNew 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"ThenDim choice AsInteger = Convert.ToInt32(resevent.Response.Substring(13, 1))
      SelectCase 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")
      EndSelect      ' 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")
      EndIf
   ' 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 = TrueEndIf
   ' Display the response on the status bar.
   StatusBar1.Text = LogResponse.ToString() + " HTML: " + resevent.Response.ToString()
EndSub
// When a ResponseSubmitted event occurs, this event handler// parses the response to determine values in the HTML form.privatevoid 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.elseif (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();
}

.NET Framework-Sicherheit

Plattformen

Windows Mobile für Pocket PC

Die .NET Framework und .NET Compact Framework unterstützen nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET framework.

Versionsinformationen

.NET Compact Framework

Unterstützt in: 3.5, 2.0

Siehe auch

Referenz

ResponseSubmittedEventArgs Klasse

Member ResponseSubmittedEventArgs

Microsoft.WindowsCE.Forms-Namespace