Partager via


Notification.Text, propriété

Mise à jour : novembre 2007

Obtient ou définit le texte de la bulle de message.

Espace de noms :  Microsoft.WindowsCE.Forms
Assembly :  Microsoft.WindowsCE.Forms (dans Microsoft.WindowsCE.Forms.dll)

Syntaxe

'Déclaration
Public Property Text As String
'Utilisation
Dim instance As Notification
Dim value As String

value = instance.Text

instance.Text = value
public string Text { get; set; }
public:
property String^ Text {
    String^ get ();
    void set (String^ value);
}
public function get Text () : String
public function set Text (value : String)

Valeur de propriété

Type : System.String

Chaîne contenant le texte HTML ou brut. La valeur par défaut est une chaîne vide ("").

Notes

Le texte peut être brut ou HTML. Le contrôle HTML Pocket PC rend le texte HTML au mieux de ses capacités. Les éléments suivants ne sont pas pris en charge et sont ignorés :

  • Balise BGSOUND

  • Images

  • Balises meta

  • Script

Utilisez la propriété Caption pour modifier le titre de la bulle de message.

Exemples

L'exemple de code suivant crée une chaîne HTML à l'aide de StringBuilder pour la valeur de la propriété Text. Cet exemple de code fait partie d'un exemple plus complet fourni pour la classe Notification.

' Create the text for the notification.
' Use a StringBuilder for better performance.
Dim HTMLString As New StringBuilder()

HTMLString.Append("<html><body>")
HTMLString.Append("<font color=""#0000FF""><b>Data ready to download</b></font>")
HTMLString.Append("&nbsp;&nbsp;&nbsp;&nbsp;<a href=""settings"">Settings</a>")
HTMLString.Append("<br><form method=""GET"" action=notify>")
HTMLString.Append("<SELECT NAME=""lstbx"">")
HTMLString.Append("<OPTION VALUE=""0"">Start now</OPTION><OPTION VALUE=""1"">In 1 hr</OPTION>")
HTMLString.Append("<OPTION VALUE=""2"">In 2 hrs</OPTION><OPTION VALUE=""3"">In 3 hrs</OPTION>")
HTMLString.Append("<OPTION VALUE=""4"">In 4 hrs</OPTION></SELECT>")
HTMLString.Append("<input type=checkbox name=chkbx>Notify completion")
HTMLString.Append("<br><input type='submit'>")
HTMLString.Append("<input type=button name='cmd:2' value='Postpone'>")
HTMLString.Append("</body></html>")

' Set the Text property to the HTML string.
Notification1.Text = HTMLString.ToString()
// Create the text for the notification.
// Use a StringBuilder for better performance.
StringBuilder HTMLString = new StringBuilder();

HTMLString.Append("<html><body>");
HTMLString.Append("<font color=\"#0000FF\"><b>Data ready to download</b></font>");
HTMLString.Append("&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"settings\">Settings</a>");
HTMLString.Append("<br><form method=\"GET\" action=notify>");
HTMLString.Append("<SELECT NAME=\"lstbx\">");
HTMLString.Append("<OPTION VALUE=\"0\">Start now</OPTION><OPTION VALUE=\"1\">In 1 hr</OPTION>");
HTMLString.Append("<OPTION VALUE=\"2\">In 2 hrs</OPTION><OPTION VALUE=\"3\">In 3 hrs</OPTION>");
HTMLString.Append("<OPTION VALUE=\"4\">In 4 hrs</OPTION></SELECT>");
HTMLString.Append("<input type=checkbox name=chkbx>Notify completion");
HTMLString.Append("<br><input type='submit'>");
HTMLString.Append("<input type=button name='cmd:2' value='Postpone'>");
HTMLString.Append("</body></html>");

// Set the Text property to the HTML string.
notification1.Text = HTMLString.ToString();

Autorisations

Plateformes

Windows Mobile pour Pocket PC

Le .NET Framework et le .NET Compact Framework ne prennent pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.

Informations de version

.NET Compact Framework

Pris en charge dans : 3.5, 2.0

Voir aussi

Référence

Notification, classe

Membres Notification

Microsoft.WindowsCE.Forms, espace de noms