Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date problem
Message
 
À
05/09/2001 15:06:45
Randy Riegel
Zimish Contracting
Ohio, États-Unis
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00552743
Message ID:
00552911
Vues:
16
>I am a beginner at Visual Basic. I've having problem with a text box formatting a date how I want it to. I want the date in the format mm/dd/yyyy. I go into the properties of the textbox and set the DataFormat field to that date format. The following code example will not use the format of the text box.
>
>
>myDate = #4/5/2001#
>Text1.Text = myDate
>

>
>The above code displays the date in the textbox as m/d/yy instead of the 4 digit year i want to show.
>
>The following is working for now but i think there should be a better way.
>
>
>myDate = #4/5/2001#
>Text1.Text = Format(myDate,"mm/dd/yyyy")
>


The DataFormat property is only to format the display (not the input) of bound (to a database using DataSource and DataField properties) fields.

Consider using the DateTimePicker control for date input.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform