Compartir a través de


ResponseSubmittedEventArgs (Clase)

Actualización: noviembre 2007

Proporciona los datos del evento ResponseSubmitted.

Espacio de nombres:  Microsoft.WindowsCE.Forms
Ensamblado:  Microsoft.WindowsCE.Forms (en Microsoft.WindowsCE.Forms.dll)

Sintaxis

'Declaración
Public Class ResponseSubmittedEventArgs _
    Inherits EventArgs
'Uso
Dim instance As ResponseSubmittedEventArgs
public class ResponseSubmittedEventArgs : EventArgs
public ref class ResponseSubmittedEventArgs : public EventArgs
public class ResponseSubmittedEventArgs extends EventArgs

Comentarios

El evento ResponseSubmitted se produce cuando la entrada del usuario descarta el globo de mensaje. Puede utilizar la propiedad Response para determinar los valores escritos en un formulario HTML desde el globo de mensaje o el nombre de un botón o vínculo en el que ha hecho clic el usuario.

Ejemplos

El ejemplo de código siguiente analiza la cadena de respuesta para determinar los elementos seleccionados por el usuario en un globo de notificación. Este ejemplo de código forma parte de un ejemplo más extenso de la clase 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();
}

Jerarquía de herencia

System.Object
  System.EventArgs
    Microsoft.WindowsCE.Forms.ResponseSubmittedEventArgs

Seguridad para subprocesos

Todos los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.

Plataformas

Windows Mobile para Pocket PC

.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Información de versión

.NET Compact Framework

Compatible con: 3.5, 2.0

Vea también

Referencia

ResponseSubmittedEventArgs (Miembros)

Microsoft.WindowsCE.Forms (Espacio de nombres)

Otros recursos

Cómo: Enviar una notificación