Afficher un message flottant en c#
Fermé
Bonjour, tou le monde
je suis entrain de realiser une mini-application en c# qui contient des combobox pour saisir des champs numeriqes, je veux savoir comment afficher un message flottant qui point sur le combobox quand l'utilisateur fait entrer une valeur qui n'est pas numerique.
merci d'avance.
je suis entrain de realiser une mini-application en c# qui contient des combobox pour saisir des champs numeriqes, je veux savoir comment afficher un message flottant qui point sur le combobox quand l'utilisateur fait entrer une valeur qui n'est pas numerique.
merci d'avance.
A voir également:
- Afficher un message flottant en c#
- Message - Guide
- Comment recuperer un message supprimé sur whatsapp - Guide
- Message d'absence thunderbird - Guide
- Epingler un message whatsapp - Accueil - Messagerie instantanée
- Message du pere noel gratuit whatsapp - Accueil - Messagerie instantanée
3 réponses
scriptiz
Messages postés
1424
Date d'inscription
dimanche 21 décembre 2008
Statut
Membre
Dernière intervention
14 septembre 2023
425
11 janv. 2009 à 13:06
11 janv. 2009 à 13:06
Qu'entends tu par message flottant?
Serait-ce une :
?
Serait-ce une :
MessageBox.Show("Entre autre chose que tu texte !");
?
scriptiz
Messages postés
1424
Date d'inscription
dimanche 21 décembre 2008
Statut
Membre
Dernière intervention
14 septembre 2023
425
13 janv. 2009 à 09:17
13 janv. 2009 à 09:17
Appelle l'évenement onChange sur ta zone de saisie, et vérifie y les données entrées dans ce controle.
Si elle ne satisfont pas tes conditions, tu modifie par exemple le texte ou la propriété Visible d'un Label qui se trouve à coté de la zone de saisie pour indiquer que les données entrées ne sont pas valides.
Tiens nous au courant si tu as des soucis.
Si elle ne satisfont pas tes conditions, tu modifie par exemple le texte ou la propriété Visible d'un Label qui se trouve à coté de la zone de saisie pour indiquer que les données entrées ne sont pas valides.
Tiens nous au courant si tu as des soucis.
svp aide moi c'est mon projet de fin d'etude que je doit faire une intranet commerciale mais le button chercher et supprimer de user controle ne marche pas .
Voila le code :
using System.Web.UI.WebControls;
using System.Collections.Generic;
using Microsoft.SharePoint;
using System;
using System.Web;
using System.Globalization;
using System.Text;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.Utilities;
using System.Configuration;
using System.IO;
using System.Web.UI;
namespace IntranetVeille.Controls
{
public partial class AjoutDocument : UserControl
{
public static string titre = null;
Double CurrentId;
protected override void CreateChildControls()
{
base.CreateChildControls();
bntajoutdocument.Click += new EventHandler(bntajoutdocument_Click);
//btnmodifierdocument.Click += new EventHandler(btnmodifierdocument_Click);
btnsupprimerdocument.Click += new EventHandler(btnsupprimerdocument_Click);
btnannuler.Click += new EventHandler(btnannuler_Click);
btnrecherchedocument.Click += new EventHandler(btnrecherchedocument_Click);
if (CurrentId != null)
{
using (SPSite oSiteCollection = new SPSite("http://oxiadev-hbrigui:808/"))
{
using (SPWeb oWeb = oSiteCollection.OpenWeb())
{
SPList oList = oWeb.Lists["panoplis"];
SPListItemCollection listItems = oWeb.Lists["panoplis"].Items;
SPListItem oListItem = oList.Items.Add();
foreach (SPListItem l in oList.Items)
{
if (l.ID == CurrentId)
{
txtNom.Text = (string)l["Titre"];
txtref.Text = (string)l["Réference"];
txtdes.Text = (string)l["Description"];
txtmot.Text = (string)l["Mot Clé"];
txtred.Text = (string)l["Rédacteur"];
radio1.Checked = (bool)l["catégorie"];
radio2.Checked = (bool)l["catégorie"];
radio3.Checked = (bool)l["catégorie"];
Calendrier.SelectedDate = (DateTime)l["Date"];
btnmodifierdocument.Visible = true;
btnsupprimerdocument.Visible = true;
bntajoutdocument.Visible = true;
btnannuler.Visible = true;
oWeb.AllowUnsafeUpdates = true;
}
}
}
}
}
}
//void btnmodifierdocument_Click(object sender, EventArgs e)
//{ //}
protected void btnrecherchedocument_Click(object sender, EventArgs e)
{
using (SPSite oSiteCollection = new SPSite("http://oxiadev-hbrigui:808/"))
{
using (SPWeb oWeb = oSiteCollection.OpenWeb())
{
oWeb.AllowUnsafeUpdates = true;
SPList oList = oWeb.Lists["panoplis"];
foreach (SPListItem l in oList.Items)
{
if (l["Titre"] != null && (txtNom.Text.Equals((l["Titre"]).ToString())))
{
MessageBox.Show("Il existe !");
//txtNom.Text = (string)l["Titre"];
//Calendrier.SelectedDate = (DateTime)l["Date"];
oWeb.AllowUnsafeUpdates = false;
}
}
//txtNom.Text = titre;
}
}
}
protected void btnannuler_Click(object sender, EventArgs e)
{
txtNom.Text = string.Empty;
txtref.Text = string.Empty;
txtdes.Text = string.Empty;
txtmot.Text = string.Empty;
txtred.Text = string.Empty;
Calendrier = null;
}
protected void btnsupprimerdocument_Click(object sender, EventArgs e)
{
try
{
using (SPSite oSiteCollection = new SPSite("http://oxiadev-hbrigui:808/"))
{
using (SPWeb oWeb = oSiteCollection.OpenWeb())
{
SPList oList = oWeb.Lists["panoplis"];
SPListItemCollection listItems = oWeb.Lists["panoplis"].Items;
int itemCount = listItems.Count;
for (int k=0; k<itemCount; k++)
{
SPListItem oListItem = listItems[k];
if (txtNom.Text == oListItem["Titre"].ToString())
{
listItems.Delete(k);
}
oList.Update();
}
}
}
}
catch (Exception Ex)
{
}
}
public void btnparcourir_Click(object sender, EventArgs e)
{
}
protected void bntajoutdocument_Click(object sender, EventArgs e)
{
using (SPSite oSiteCollection = new SPSite("http://oxiadev-hbrigui:808/"))
{
using (SPWeb oWeb = oSiteCollection.OpenWeb())
{
SPList oList = oWeb.Lists["panoplis"];
SPListItemCollection listItems = oWeb.Lists["panoplis"].Items;
SPListItem oListItem = oList.Items.Add();
for ( var i=0 ; i<= 3 ; i++){
if(radio1.Checked ){
oListItem["catégorie"]=radio1.Text.ToString();
}
else {
if(radio2.Checked ){
oListItem["catégorie"] = radio2.Text.ToString();
}
else {
oListItem["catégorie"] = radio3.Text.ToString();
}
}
}
oListItem["Titre"] = txtNom.Text ;
oListItem["Réference"] = txtref.Text ;
oListItem["Description"] = txtdes.Text ;
oListItem["Mot Clé"] = txtmot.Text ;
oListItem["Rédacteur"] = txtred.Text ;
oListItem["Date"] = Calendrier.SelectedDate.ToShortDateString();
oListItem.Update();
oList.Update();
oWeb.AllowUnsafeUpdates = false;
}}
}
}
}
Voila le code :
using System.Web.UI.WebControls;
using System.Collections.Generic;
using Microsoft.SharePoint;
using System;
using System.Web;
using System.Globalization;
using System.Text;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.Utilities;
using System.Configuration;
using System.IO;
using System.Web.UI;
namespace IntranetVeille.Controls
{
public partial class AjoutDocument : UserControl
{
public static string titre = null;
Double CurrentId;
protected override void CreateChildControls()
{
base.CreateChildControls();
bntajoutdocument.Click += new EventHandler(bntajoutdocument_Click);
//btnmodifierdocument.Click += new EventHandler(btnmodifierdocument_Click);
btnsupprimerdocument.Click += new EventHandler(btnsupprimerdocument_Click);
btnannuler.Click += new EventHandler(btnannuler_Click);
btnrecherchedocument.Click += new EventHandler(btnrecherchedocument_Click);
if (CurrentId != null)
{
using (SPSite oSiteCollection = new SPSite("http://oxiadev-hbrigui:808/"))
{
using (SPWeb oWeb = oSiteCollection.OpenWeb())
{
SPList oList = oWeb.Lists["panoplis"];
SPListItemCollection listItems = oWeb.Lists["panoplis"].Items;
SPListItem oListItem = oList.Items.Add();
foreach (SPListItem l in oList.Items)
{
if (l.ID == CurrentId)
{
txtNom.Text = (string)l["Titre"];
txtref.Text = (string)l["Réference"];
txtdes.Text = (string)l["Description"];
txtmot.Text = (string)l["Mot Clé"];
txtred.Text = (string)l["Rédacteur"];
radio1.Checked = (bool)l["catégorie"];
radio2.Checked = (bool)l["catégorie"];
radio3.Checked = (bool)l["catégorie"];
Calendrier.SelectedDate = (DateTime)l["Date"];
btnmodifierdocument.Visible = true;
btnsupprimerdocument.Visible = true;
bntajoutdocument.Visible = true;
btnannuler.Visible = true;
oWeb.AllowUnsafeUpdates = true;
}
}
}
}
}
}
//void btnmodifierdocument_Click(object sender, EventArgs e)
//{ //}
protected void btnrecherchedocument_Click(object sender, EventArgs e)
{
using (SPSite oSiteCollection = new SPSite("http://oxiadev-hbrigui:808/"))
{
using (SPWeb oWeb = oSiteCollection.OpenWeb())
{
oWeb.AllowUnsafeUpdates = true;
SPList oList = oWeb.Lists["panoplis"];
foreach (SPListItem l in oList.Items)
{
if (l["Titre"] != null && (txtNom.Text.Equals((l["Titre"]).ToString())))
{
MessageBox.Show("Il existe !");
//txtNom.Text = (string)l["Titre"];
//Calendrier.SelectedDate = (DateTime)l["Date"];
oWeb.AllowUnsafeUpdates = false;
}
}
//txtNom.Text = titre;
}
}
}
protected void btnannuler_Click(object sender, EventArgs e)
{
txtNom.Text = string.Empty;
txtref.Text = string.Empty;
txtdes.Text = string.Empty;
txtmot.Text = string.Empty;
txtred.Text = string.Empty;
Calendrier = null;
}
protected void btnsupprimerdocument_Click(object sender, EventArgs e)
{
try
{
using (SPSite oSiteCollection = new SPSite("http://oxiadev-hbrigui:808/"))
{
using (SPWeb oWeb = oSiteCollection.OpenWeb())
{
SPList oList = oWeb.Lists["panoplis"];
SPListItemCollection listItems = oWeb.Lists["panoplis"].Items;
int itemCount = listItems.Count;
for (int k=0; k<itemCount; k++)
{
SPListItem oListItem = listItems[k];
if (txtNom.Text == oListItem["Titre"].ToString())
{
listItems.Delete(k);
}
oList.Update();
}
}
}
}
catch (Exception Ex)
{
}
}
public void btnparcourir_Click(object sender, EventArgs e)
{
}
protected void bntajoutdocument_Click(object sender, EventArgs e)
{
using (SPSite oSiteCollection = new SPSite("http://oxiadev-hbrigui:808/"))
{
using (SPWeb oWeb = oSiteCollection.OpenWeb())
{
SPList oList = oWeb.Lists["panoplis"];
SPListItemCollection listItems = oWeb.Lists["panoplis"].Items;
SPListItem oListItem = oList.Items.Add();
for ( var i=0 ; i<= 3 ; i++){
if(radio1.Checked ){
oListItem["catégorie"]=radio1.Text.ToString();
}
else {
if(radio2.Checked ){
oListItem["catégorie"] = radio2.Text.ToString();
}
else {
oListItem["catégorie"] = radio3.Text.ToString();
}
}
}
oListItem["Titre"] = txtNom.Text ;
oListItem["Réference"] = txtref.Text ;
oListItem["Description"] = txtdes.Text ;
oListItem["Mot Clé"] = txtmot.Text ;
oListItem["Rédacteur"] = txtred.Text ;
oListItem["Date"] = Calendrier.SelectedDate.ToShortDateString();
oListItem.Update();
oList.Update();
oWeb.AllowUnsafeUpdates = false;
}}
}
}
}
11 janv. 2009 à 13:24
je veux dir un message qui indique à l'utilisateur que c'est un champs ou il doit faire entrer des valeur numerique mais sans avoir besoin d'afficher un text box. ressamblant aumessage qui apparaissent quand on point sur un controle dans une interface et qui indique la fonction du controle.