UserName & Password

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mclueless
    New Member
    • Jan 2008
    • 56

    UserName & Password

    I am working with VB6. Here, i have a form with User name and password fields. I do no want the user to be allowed to type in capital letters in these two fields. only small letters should be allowed. how can this be done???
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by mclueless
    ...I do no want the user to be allowed to type in capital letters in these two fields. only small letters should be allowed.
    In the KeyDown or KeyPress event for the textbox (I'm assuming they're textboxes) just check what value was received.

    If you don't like what you see, either prevent it going through, or convert it to lowercase.

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      But it is not recommended to restrict the username and password to certain case only. So what you can do is receive the value from userinput and store in a desired format (uppercase,lowe rcase etc) and at the time of userlogin compare the same.

      Comment

      • lotus18
        Contributor
        • Nov 2007
        • 865

        #4
        Originally posted by mclueless
        I am working with VB6. Here, i have a form with User name and password fields. I do no want the user to be allowed to type in capital letters in these two fields. only small letters should be allowed. how can this be done???
        Huh? Accepting only lowercase for both fields (username and password)? This is unusual ^ ^

        Rey Sean

        Comment

        • daniel aristidou
          Contributor
          • Aug 2007
          • 494

          #5
          If you make the username and pasword non case specific....... .then why bother trying to restrict case since it will be ignored anyway.
          This is assuming your checking the username and password using code that ignores casing....

          Comment

          • Baglovely
            New Member
            • Jan 2008
            • 4

            #6
            Two options;

            1. Under TextChanged for the text boxes type:
            txtBox.Text = LCase(txtBox.Te xt)

            2. Change the Property "CharacterCasin g" for the TextBox to Lower
            Last edited by Killer42; Jan 25 '08, 01:17 AM. Reason: Corrected "Charachter"

            Comment

            • werks
              New Member
              • Dec 2007
              • 218

              #7
              Originally posted by Baglovely
              Two options;

              1. Under TextChanged for the text boxes type:
              txtBox.Text = LCase(txtBox.Te xt)

              2. Change the Property "CharacterCasin g" for the TextBox to Lower
              I agree with Baglovely.. OR you can use an Keyascii for it


              Better Than Yesterday
              Last edited by Killer42; Jan 25 '08, 01:17 AM. Reason: Corrected "Charachter"

              Comment

              • Killer42
                Recognized Expert Expert
                • Oct 2006
                • 8429

                #8
                Originally posted by werks
                I agree with Baglovely.. OR you can use an Keyascii for it
                VB6 doesn't have this property.

                Comment

                • Ali Rizwan
                  Banned
                  Contributor
                  • Aug 2007
                  • 931

                  #9
                  Originally posted by mclueless
                  I am working with VB6. Here, i have a form with User name and password fields. I do no want the user to be allowed to type in capital letters in these two fields. only small letters should be allowed. how can this be done???
                  If you use Lcase property under change event it will make a trouble to user.
                  When user clicks on Save or Ok button write this code under the click event.

                  [CODE=vb]txtuser.Text = LCase(txtuser)
                  txtpassword.Tex t = LCase(txtpasswo rd)[/CODE]

                  Regards
                  >> ALI <<
                  Last edited by Killer42; Jan 28 '08, 03:21 AM. Reason: Changed [CODE] to [CODE=vb]

                  Comment

                  • werks
                    New Member
                    • Dec 2007
                    • 218

                    #10
                    Originally posted by Killer42
                    VB6 doesn't have this property.
                    Sorry but what do you mean?

                    Better Than Yesterday ^^

                    Comment

                    • Killer42
                      Recognized Expert Expert
                      • Oct 2006
                      • 8429

                      #11
                      Originally posted by werks
                      Sorry but what do you mean?
                      Sorry, put my reply on the wrong post. I meant that VB6 doesn't have a CharacterCasing property on textboxes.

                      Comment

                      • Ali Rizwan
                        Banned
                        Contributor
                        • Aug 2007
                        • 931

                        #12
                        Sorry for some errors in my code use UCase instead of LCase

                        UCase() = Convert alphabets to Upper Case
                        LCase() = Convert alphabets to Lower Case

                        Regards
                        >> ALI <<

                        Comment

                        • cvraghavan1979
                          New Member
                          • Jan 2008
                          • 28

                          #13
                          Originally posted by Ali Rizwan
                          Sorry for some errors in my code use UCase instead of LCase

                          UCase() = Convert alphabets to Upper Case
                          LCase() = Convert alphabets to Lower Case

                          Regards
                          >> ALI <<

                          hi ali,

                          pls try

                          sub txtUserName_Key press( )

                          if keyascii>=65 and keyascii<=122 'ascii for A- Z
                          keyascii = keyascii + 32 ' 65 + 32 : 97 , 97 - 122 : a - z
                          end if
                          end sub

                          Comment

                          • werks
                            New Member
                            • Dec 2007
                            • 218

                            #14
                            Originally posted by Killer42
                            Sorry, put my reply on the wrong post. I meant that VB6 doesn't have a CharacterCasing property on textboxes.

                            hehehe..lol


                            Better Than Yesterday ^^

                            Comment

                            Working...