Formating the Data in a Text Box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vishnu

    #1

    Formating the Data in a Text Box

    Just like the way we set the format for a cell in a excel sheet....how can i
    format the data in my text box...
    I want to know how to format a text box for the following data
    1. Month/Date/Year = MM/DD/YYYY
    2. Time = Hours: Mins

  • Cor Ligthert [MVP]

    #2
    Re: Formating the Data in a Text Box

    Vishnu,

    That depends what the culture is that is used. The OS for which are .Net
    have the dates work on the way the culture is set in the setting of the
    system.

    Therefore first what do you mean with MM/DD/YYYY as month/date/year

    The nearest date description I know is MM/dd/yyyy which means month as 2
    ciphers, day 2 ciphers, year 4 ciphers. I assume that you mean with date,
    day however to be sure.

    So maybe can you make this clear, before you get a bunch of answers which do
    in fact not work.

    Cor


    Comment

    • Vishnu

      #3
      Re: Formating the Data in a Text Box

      Cor,
      You are right...MM/DD/YYYY is Month/Date/Year...I want to know if there are
      any fuctions in VB.NET which can be used to format a text box...Let me know

      "Cor Ligthert [MVP]" wrote:
      [color=blue]
      > Vishnu,
      >
      > That depends what the culture is that is used. The OS for which are .Net
      > have the dates work on the way the culture is set in the setting of the
      > system.
      >
      > Therefore first what do you mean with MM/DD/YYYY as month/date/year
      >
      > The nearest date description I know is MM/dd/yyyy which means month as 2
      > ciphers, day 2 ciphers, year 4 ciphers. I assume that you mean with date,
      > day however to be sure.
      >
      > So maybe can you make this clear, before you get a bunch of answers which do
      > in fact not work.
      >
      > Cor
      >
      >
      >[/color]

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Formating the Data in a Text Box

        > You are right...MM/DD/YYYY is Month/Date/Year...I want to know if there[color=blue]
        > are
        > any fuctions in VB.NET which can be used to format a text box...Let me
        > know
        >[/color]
        And how should the date than be presented, I asked you if you did mean day,
        however now you confess that it is date, what should than that DD look like?

        Cor


        Comment

        • Vishnu

          #5
          Re: Formating the Data in a Text Box

          Cor

          The user will be entering the date for Example 10/31/2005..



          "Cor Ligthert [MVP]" wrote:
          [color=blue][color=green]
          > > You are right...MM/DD/YYYY is Month/Date/Year...I want to know if there
          > > are
          > > any fuctions in VB.NET which can be used to format a text box...Let me
          > > know
          > >[/color]
          > And how should the date than be presented, I asked you if you did mean day,
          > however now you confess that it is date, what should than that DD look like?
          >
          > Cor
          >
          >
          >[/color]

          Comment

          • Cor Ligthert [MVP]

            #6
            Re: Formating the Data in a Text Box

            You still did not gave an answer however have a look to this in a simple
            format.

            TextBox1.Text = (CDate("31-12-2005")).ToStrin g("d")

            This is in my culture.
            Have a look at this

            http://msdn.microsoft.com/library/de...classtopic.asp

            In version 2005 there is the maskedtextbox

            http://msdn2.microsoft.com/en-us/lib...edtextbox.mask

            I hope this helps,

            Cor

            "Vishnu" <Vishnu@discuss ions.microsoft. com> schreef in bericht
            news:332547F4-98FC-4BDE-B918-9DF545DB9608@mi crosoft.com...[color=blue]
            > Cor
            >
            > The user will be entering the date for Example 10/31/2005..
            >
            >
            >
            > "Cor Ligthert [MVP]" wrote:
            >[color=green][color=darkred]
            >> > You are right...MM/DD/YYYY is Month/Date/Year...I want to know if there
            >> > are
            >> > any fuctions in VB.NET which can be used to format a text box...Let me
            >> > know
            >> >[/color]
            >> And how should the date than be presented, I asked you if you did mean
            >> day,
            >> however now you confess that it is date, what should than that DD look
            >> like?
            >>
            >> Cor
            >>
            >>
            >>[/color][/color]


            Comment

            Working...