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. slashes in textbox

slashes in textbox

Scheduled Pinned Locked Moved Visual Basic
help
7 Posts 4 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.
  • A Offline
    A Offline
    amaneet
    wrote on last edited by
    #1

    Sir/Madam Can i insert the slashes in the textbox (two slashes) for the user to insert the date(day,month,year). Please help Thanks and Regards Pankaj

    M K J 3 Replies Last reply
    0
    • A amaneet

      Sir/Madam Can i insert the slashes in the textbox (two slashes) for the user to insert the date(day,month,year). Please help Thanks and Regards Pankaj

      M Offline
      M Offline
      Marcus J Smith
      wrote on last edited by
      #2

      Unless something has changed with 2.0, you will have to create a custom control for this. I did something similar but it was kind of ugly by taking 5 textboxes, the 1st, 3rd, and 5th had the appropriate borders blanked out and the 2nd and the 4th contained the slashes then you put them all side by side with no spaces. Then you use an autotab JS function to make it seem as if they are just typing through a mask in the textbox. It will appear to be a textbox but there has to be a better way.


      CleAkO

      "I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy
      "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)

      1 Reply Last reply
      0
      • A amaneet

        Sir/Madam Can i insert the slashes in the textbox (two slashes) for the user to insert the date(day,month,year). Please help Thanks and Regards Pankaj

        K Offline
        K Offline
        KeithF
        wrote on last edited by
        #3

        There is a MaskedTextBox in .Net 2.0 using Visual Studio 2005 that you can use.

        M 1 Reply Last reply
        0
        • K KeithF

          There is a MaskedTextBox in .Net 2.0 using Visual Studio 2005 that you can use.

          M Offline
          M Offline
          Marcus J Smith
          wrote on last edited by
          #4

          Thank goodness!


          CleAkO

          "I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy
          "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)

          1 Reply Last reply
          0
          • A amaneet

            Sir/Madam Can i insert the slashes in the textbox (two slashes) for the user to insert the date(day,month,year). Please help Thanks and Regards Pankaj

            J Offline
            J Offline
            JustmeNick
            wrote on last edited by
            #5

            if you need those / for date purposes..its easier to declare a date object to collect the information and asign the input to that variable.. after the variable or object gets the input as string..u format it to represent what u want... example: dim TD as Date TD = textbox1.text msgbox(TD.tostring("dd/MM/yyyy") i just use a message box to display the result..but the same applies were ever u use it..

            Nab

            M 1 Reply Last reply
            0
            • J JustmeNick

              if you need those / for date purposes..its easier to declare a date object to collect the information and asign the input to that variable.. after the variable or object gets the input as string..u format it to represent what u want... example: dim TD as Date TD = textbox1.text msgbox(TD.tostring("dd/MM/yyyy") i just use a message box to display the result..but the same applies were ever u use it..

              Nab

              M Offline
              M Offline
              Marcus J Smith
              wrote on last edited by
              #6

              Thats true but I think the OP is asking how to display those in the textbox so that someone understands that it is looking for a date.


              CleaKO

              "I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy
              "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)

              J 1 Reply Last reply
              0
              • M Marcus J Smith

                Thats true but I think the OP is asking how to display those in the textbox so that someone understands that it is looking for a date.


                CleaKO

                "I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy
                "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)

                J Offline
                J Offline
                JustmeNick
                wrote on last edited by
                #7

                just use a datetimepicker

                Nab

                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