Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Formatting a masked Text box

Formatting a masked Text box

Scheduled Pinned Locked Moved Visual Basic
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Central_IT
    wrote on last edited by
    #1

    I have a masked text box that displays a date dd/mm/yyyy e.g. 01/03/2007 When I try and change the format to read yyyy-mm-dd, it displays yyyy-mm-dd and not 2007-03-01 If it was any ordinary text box the syntax is format(MyDateField.Text, "yyyy-mm-dd") and it works. It does not when the text box is masked. I must be doing something stupid or missing syntax. How do I get a masked text box to format correctly as above?

    S 1 Reply Last reply
    0
    • C Central_IT

      I have a masked text box that displays a date dd/mm/yyyy e.g. 01/03/2007 When I try and change the format to read yyyy-mm-dd, it displays yyyy-mm-dd and not 2007-03-01 If it was any ordinary text box the syntax is format(MyDateField.Text, "yyyy-mm-dd") and it works. It does not when the text box is masked. I must be doing something stupid or missing syntax. How do I get a masked text box to format correctly as above?

      S Offline
      S Offline
      Simon_Whale
      wrote on last edited by
      #2

      Have a look at the datetimepicker control, could this handle your requirements better? MSDN: Datetimepicker control[^]

      Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups