CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: maskedit date

  1. #1
    Join Date
    Aug 2000
    Posts
    5

    maskedit date

    I have a maskedit control with mask ##/##/##__## I'm trying to change to format of the date when the box loses focus, leaving the last two ## alone. I want to get the first 6 number and change it to mm/dd/yy. Any ideas?
    thanks,


  2. #2
    Guest

    Re: maskedit date

    Try this:

    option Explicit
    Dim strTemp as string
    private Sub MaskEdBox1_LostFocus()
    'get 6 left characters first
    strTemp = Left(MaskEdBox1.ClipText, 6)
    'clear the box and change the mask
    With MaskEdBox1
    .Mask = ""
    .Mask = "##/##/##"
    'assign saved value
    .SelText = strTemp
    End With
    End Sub



    Vlad


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

Featured