By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,067 Members | 1,849 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,067 IT Pros & Developers. It's quick & easy.

UserName & Password

P: 56
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???
Jan 21 '08 #1
Share this Question
Share on Google+
13 Replies


Expert 5K+
P: 8,434
...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.
Jan 22 '08 #2

debasisdas
Expert 5K+
P: 8,127
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,lowercase etc) and at the time of userlogin compare the same.
Jan 22 '08 #3

lotus18
100+
P: 866
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
Jan 22 '08 #4

daniel aristidou
100+
P: 491
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....
Jan 22 '08 #5

P: 4
Two options;

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

2. Change the Property "CharacterCasing" for the TextBox to Lower
Jan 24 '08 #6

werks
100+
P: 220
Two options;

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

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


Better Than Yesterday
Jan 24 '08 #7

Expert 5K+
P: 8,434
I agree with Baglovely.. OR you can use an Keyascii for it
VB6 doesn't have this property.
Jan 25 '08 #8

Ali Rizwan
100+
P: 927
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.

Expand|Select|Wrap|Line Numbers
  1. txtuser.Text = LCase(txtuser)
  2. txtpassword.Text = LCase(txtpassword)
Regards
>> ALI <<
Jan 27 '08 #9

werks
100+
P: 220
VB6 doesn't have this property.
Sorry but what do you mean?

Better Than Yesterday ^^
Jan 28 '08 #10

Expert 5K+
P: 8,434
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.
Jan 28 '08 #11

Ali Rizwan
100+
P: 927
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 <<
Jan 29 '08 #12

P: 28
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_Keypress( )

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

werks
100+
P: 220
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 ^^
Jan 29 '08 #14

Post your reply

Sign in to post your reply or Sign up for a free account.