943,613 Members | Top Members by Rank

Ad:
Jul 4th, 2009
0

How to use textbox to enter date

Expand Post »
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 )
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
kehar is offline Offline
72 posts
since Sep 2007
Jul 4th, 2009
0

Re: How to use textbox to enter date

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?
Reputation Points: 156
Solved Threads: 296
Posting Virtuoso
vb5prgrmr is offline Offline
1,670 posts
since Mar 2009
Jul 6th, 2009
0

Re: How to use textbox to enter date

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)
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
kehar is offline Offline
72 posts
since Sep 2007
Jul 6th, 2009
0

Re: How to use textbox to enter date

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
Reputation Points: 156
Solved Threads: 296
Posting Virtuoso
vb5prgrmr is offline Offline
1,670 posts
since Mar 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: how to use a picture box as a media tool
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: How to add data into two table?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC