How to use textbox to enter date

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Sep 2007
Posts: 70
Reputation: kehar is an unknown quantity at this point 
Solved Threads: 0
kehar kehar is offline Offline
Junior Poster in Training

How to use textbox to enter date

 
0
  #1
Jul 4th, 2009
Hi,
I would like to use textbox to accept date in VB 6 instead of using dtpicker. The text box should contain oblique sign like ( / / ) to enter dd/MM/YYYY type date during form load.
I tried to use Microsoft Mask Edit control also but it is showing unscore when the textbox get focus.
So pl help me.

(Kehar )
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 834
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 152
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark

Re: How to use textbox to enter date

 
0
  #2
Jul 4th, 2009
So then you are using this as your mask?
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. MEB.Mask = "##/##/####"

And you have a problem with the way the control displays this in the standard way that people have come to know?
If anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 70
Reputation: kehar is an unknown quantity at this point 
Solved Threads: 0
kehar kehar is offline Offline
Junior Poster in Training

Re: How to use textbox to enter date

 
0
  #3
Jul 6th, 2009
Yes, the moment the text box get focus an underscore is coming in it though it is responding the date. But how to prevent the underscore from being appeared ?

(Kehar)
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 834
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 152
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark

Re: How to use textbox to enter date

 
0
  #4
Jul 6th, 2009
You can't as far as I know but then again you may be able to subclass the control. You can however use a standard textbox control and set its initial text to " / / ", then test for numbers on keypress to make sure user is entering numbers and if user has entered a number then you would replace the first space with what the user has entered. On the other hand you could use the DTPicker(date time picker) control with a custom format if needed and just allow the user to pick the date.


Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC