How i prepare a Textbox for date input?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: How i prepare a Textbox for date input?

  1. #1
    Join Date
    Sep 2011
    Posts
    13

    Question How i prepare a Textbox for date input?

    How i prepare a Textbox for date input?
    I try using the format function:

    Me.txtFechadeEntrada.MaxLength = 8
    mascarafechaentrada = Format(Me.txtFechadeEntrada.Text, "##/##/##")

    And on saveclick this ,I need save the data to a text file with a specific format I delete the /.

    mascarafechaentrada = Format(Me.txtFechadeEntrada.Text, "######")
    Me.txtFechadeEntrada.MaxLength = 6

    But don't work because the user can type this 11112//2.

    My last choice is to use date picker control or textbox=format (Date,yy/mm/dd).
    But I prefer the user to type the date in the text box.
    Sorry for my English
    Any help is very appreciated
    Last edited by pcfry; November 26th, 2011 at 04:13 AM.

  2. #2
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,784

    Re: How i prepare a Textbox for date input?

    You may want to use the mask edit box
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Sep 2011
    Posts
    13

    Re: How i prepare a Textbox for date input?

    The maskeditbox is another control like the date picker. I looking for a way to use a text box.

    You know a way to use a maskedit in a text box?
    Thanks for answer anyway

  4. #4
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,875

    Re: How i prepare a Textbox for date input?

    Use a HIDDEN TextBox to format items.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Sep 2011
    Posts
    13

    Re: How i prepare a Textbox for date input?

    Ok let try that .
    I will post

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center