Alphabets and numbers displayed in certain order

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prigupta2
    New Member
    • Oct 2008
    • 33

    Alphabets and numbers displayed in certain order

    i want to type Alphabets and numbers in text box in such a way
    first alphabets then number
    ex
    C102
    M458


    only CM0123456789

    please provide code in vb6.0
  • lotus18
    Contributor
    • Nov 2007
    • 865

    #2
    Just get the keyascii value of the keys that you pressed under the keypress event of the textbox then restrict the textbox that the first character must not accept numeric values.

    Or you can use maskededit box to solve this problem


    Rey Sean

    Comment

    • prigupta2
      New Member
      • Oct 2008
      • 33

      #3
      thanks
      but i need a code

      Char = Chr(KeyAscii)
      KeyAscii = Asc(UCase(Char) )

      p501 = "CM01234567 89" + Chr$(127) + Chr$(8)
      If InStr(p501, Chr$(KeyAscii)) = 0 Then
      KeyAscii = 0

      how to restrict first letter should be character

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        try to define a function and validate the string after user input

        Comment

        • prigupta2
          New Member
          • Oct 2008
          • 33

          #5
          subtract time

          i want to subtract time


          Private Sub Timer1_Timer() Start Time
          label1.Caption = Format(Time)
          End Sub

          Private Sub Timer2_Timer() End time
          label2.Caption = Format(Time)
          End Sub

          how to subtract (End time - Start Time)

          ex. 12:15:40 - 10:15:30 = 02:00:10
          End time Start Time ??????

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            you need to use DATEDIFF function .

            DateDiff(interv al, date1, date2[, firstdayofweek[, firstweekofyear]])
            Where interval will be in string as
            yyyy Year
            q Quarter
            m Month
            y Day of year
            d Day
            w Weekday
            ww Week
            h Hour
            n Minute
            s Second
            It will return difference of two dates as long according to parameters provided.

            Comment

            • prigupta2
              New Member
              • Oct 2008
              • 33

              #7
              hi
              i want to make 30 days trial setup of my software (vb6.0)
              please suggest me

              Comment

              • debasisdas
                Recognized Expert Expert
                • Dec 2006
                • 8119

                #8
                handle the registry at the time of installation.

                Comment

                Working...