Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hi, is there any possibility to enter the date value in the textbox without

using datetimepicker by using vb.net coding
Posted
Comments
Prerak Patel 22-Nov-11 4:39am    
What do you mean? You can use masked textbox but then you need to validate the entered date.

You mean something like:
TextBox1.Text = Format(Date.Now, "dd-MM-yyyy")
 
Share this answer
 
Comments
nit_san 3-Dec-12 8:52am    
im tryin this code but date is not exact. i also tried using by ToShortDateString but i need the same format as written below. its not cming.. ?? need help
textBox1.Text = dtp.ToString("yyyy-mm-dd");
Scubapro 3-Dec-12 13:22pm    
I'm guessing the dtp is your datetimepicker? Then use:

TextBox1.Text = Format(dtp.value,"yyyy-MM-dd")
textbox1.text=date.now (or) textbox1.text=formate(cdate(now),"HH:MM:SS").tostring
 
Share this answer
 
Comments
Scubapro 22-Nov-11 5:48am    
Your first solution will produce a date and time, and whatever your second solution should produce, it's not going to be a date!
Suraj Tadge 2-Jun-13 2:54am    
how to add datetimepicker value in textbox?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900