Faire un controle sur les dates en C#.net
manue514
-
zorro -
zorro -
Bonjour,
je souhaiterais faire un contrôle sur les dates saisies en entrées de facon à ce qu'elles respectent un certain format : JJ/MM/AAAA
Je ne sais comment le programmer, voici un bout de mon code pour la saisie de la date :
// t_datefin
this.t_datefin.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.t_datefin.Location = new System.Drawing.Point(328, 40);
this.t_datefin.Name = "t_datefin";
this.t_datefin.Size = new System.Drawing.Size(90, 20);
this.t_datefin.TabIndex = 15;
this.t_datefin.Text = "";
this.infobulle.SetToolTip(this.t_datefin, "Date de fin de l\'affaire.");
Merci pour votre aide
Manue
je souhaiterais faire un contrôle sur les dates saisies en entrées de facon à ce qu'elles respectent un certain format : JJ/MM/AAAA
Je ne sais comment le programmer, voici un bout de mon code pour la saisie de la date :
// t_datefin
this.t_datefin.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.t_datefin.Location = new System.Drawing.Point(328, 40);
this.t_datefin.Name = "t_datefin";
this.t_datefin.Size = new System.Drawing.Size(90, 20);
this.t_datefin.TabIndex = 15;
this.t_datefin.Text = "";
this.infobulle.SetToolTip(this.t_datefin, "Date de fin de l\'affaire.");
Merci pour votre aide
Manue
A voir également:
- Faire un controle sur les dates en C#.net
- Net framework 2.0 - Télécharger - Divers Utilitaires
- Paint net - Télécharger - Dessin & Illustration
- Net framework 4.0 - Télécharger - Divers Utilitaires
- Nombre de jours entre deux dates excel - Guide
- Comment ouvrir un fichier dat - Guide
1 réponse
Voilà comment formater un champs date!
// Format : 07 / 03 / 2004
formattedDate = DateTime.Now.ToString("dd / MM / yyyy");
solution trouvé ici :
https://www.dotnetspider.com/resources/266-Formatting-Date-Time-using-e-DateTime-object.aspx
// Format : 07 / 03 / 2004
formattedDate = DateTime.Now.ToString("dd / MM / yyyy");
solution trouvé ici :
https://www.dotnetspider.com/resources/266-Formatting-Date-Time-using-e-DateTime-object.aspx