|
-
Sep 26th, 2005, 12:32 AM
#1
Thread Starter
Member
[RESOLVED] Another Date Formatting problem, please help me.
Hi,
I'm stuck with this task. I have a text box named tb_StartDate and I would like to ask if this is possible to mask this field with this character " / / " when the user is on or is about to make an entry to this box:
Goods Issue Date : [ / / ]
Initially, my program has this format but only when the user leaves that date prompt:
VB Code:
Private Sub tb_StartDate_LostFocus()
tb_StartDate.Text = Format(tb_StartDate.Text, "##/##/##")
End Sub
Thanking you in advance.
-
Sep 26th, 2005, 12:35 AM
#2
Re: Another Date Formatting problem, please help me.
Why not use a Masked Edit control instead?
Last edited by dee-u; Sep 26th, 2005 at 12:43 AM.
-
Sep 26th, 2005, 12:48 AM
#3
Hyperactive Member
Re: Another Date Formatting problem, please help me.
Hello ejpotpot,
 Originally Posted by dee-u
Why not use a Masked Edit control instead?
go to project -> components -> check the Microsoft Edit Control
Best Regards,
ERAN
Last edited by eranfox; Sep 26th, 2005 at 12:52 AM.
Eran Fox
ASSEMBLER,C,C++,VB6,SQL...
-
Sep 26th, 2005, 12:50 AM
#4
Re: Another Date Formatting problem, please help me.
Masked Edit control is a pain to work with. Why not just add a calendar control.
I show a small form with a calendar control when the user clicks on a textbox that is supposed to have a date in it. Then I put the date into the textbox when they exit the calendar form.
It is much easier.
-
Sep 26th, 2005, 12:55 AM
#5
Re: Another Date Formatting problem, please help me.
 Originally Posted by dglienna
Masked Edit control is a pain to work with. Why not just add a calendar control.
I show a small form with a calendar control when the user clicks on a textbox that is supposed to have a date in it. Then I put the date into the textbox when they exit the calendar form.
It is much easier.
Why did you say that it's a pain to work with?
-
Sep 26th, 2005, 12:58 AM
#6
Thread Starter
Member
Re: Another Date Formatting problem, please help me.
Thank you guys !!!
 Originally Posted by eranfox
Hello ejpotpot,
go to project -> components -> check the Microsoft Edit Control
Best Regards,
ERAN
-
Sep 26th, 2005, 12:59 AM
#7
Re: Another Date Formatting problem, please help me.
Because you have to enter leading zeroes, and can't tab thru. I'd prefer 3 textboxes to the masked edit control. It's not hard for the programmer, but is a pain for the user. Clearing the mask edit is a two step process as well.
-
Sep 26th, 2005, 01:07 AM
#8
Thread Starter
Member
Re: Another Date Formatting problem, please help me.
Thanks dglienna. Yeah your right, have to enter leading Os but anyway, my initial task has the solution.
Cheers to ya all!
 Originally Posted by dglienna
Because you have to enter leading zeroes, and can't tab thru. I'd prefer 3 textboxes to the masked edit control. It's not hard for the programmer, but is a pain for the user. Clearing the mask edit is a two step process as well.
-
Sep 26th, 2005, 01:23 AM
#9
Re: Another Date Formatting problem, please help me.
 Originally Posted by dglienna
Because you have to enter leading zeroes, and can't tab thru. I'd prefer 3 textboxes to the masked edit control. It's not hard for the programmer, but is a pain for the user. Clearing the mask edit is a two step process as well.
I don't get it, I never had a problem with the Masked Edit, could you provide a sample form?
-
Sep 26th, 2005, 02:00 AM
#10
Re: [RESOLVED] Another Date Formatting problem, please help me.
Try a masked edit box for an IP addresss. I think that was the project that convinced me that it wasn't worth it.
-
Sep 26th, 2005, 02:17 AM
#11
Re: [RESOLVED] Another Date Formatting problem, please help me.
I thought it's about date? I use it mainly for dates and never had problems with it... And what do you mean by "Clearing the mask edit is a two step process as well." How aer you doing it?
-
Oct 3rd, 2005, 02:00 AM
#12
Member
Re: [RESOLVED] Another Date Formatting problem, please help me.
dglienna, we need more info on problems with mask control, and what is the alternative to it.
i need mask edit for date, and yes, if user enter a single digit, then control should make it two digits on its own, by having leading 0. also, when user enter single digit, control should go to months place automatically....with or without mask edit ..how???
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|