Results 1 to 12 of 12

Thread: [RESOLVED] Another Date Formatting problem, please help me.

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2005
    Posts
    45

    Resolved [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:
    1. Private Sub tb_StartDate_LostFocus()
    2.   tb_StartDate.Text = Format(tb_StartDate.Text, "##/##/##")
    3. End Sub

    Thanking you in advance.

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    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.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3
    Hyperactive Member eranfox's Avatar
    Join Date
    May 2001
    Posts
    492

    Re: Another Date Formatting problem, please help me.

    Hello ejpotpot,
    Quote 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...

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  5. #5
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Another Date Formatting problem, please help me.

    Quote 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?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  6. #6

    Thread Starter
    Member
    Join Date
    Jul 2005
    Posts
    45

    Re: Another Date Formatting problem, please help me.

    Thank you guys !!!

    Quote Originally Posted by eranfox
    Hello ejpotpot,

    go to project -> components -> check the Microsoft Edit Control

    Best Regards,
    ERAN

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  8. #8

    Thread Starter
    Member
    Join Date
    Jul 2005
    Posts
    45

    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!

    Quote 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.

  9. #9
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Another Date Formatting problem, please help me.

    Quote 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?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  10. #10
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  11. #11
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    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?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  12. #12
    Member
    Join Date
    Feb 2005
    Posts
    62

    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
  •  



Click Here to Expand Forum to Full Width