Hello,
I am currently trying to create a login screen and I have done so with 2 simple labels and 2 textboxes.
On the labels the texts were "Login ID:" and "Password:" (not important)
On the textboxes, they were just blank for user input. Their names are "ID" and "pwd"
The problem I am having is that I need to protect the password from being viewed just like you would see from logging into this website.
So, this means that any keys the user inputs into pwd textbox, it would have to appear as * for each character!
This code works fine when the user inputs a character by character or copy+paste:
But when a text is highlighted and replaced with an input (without erasing the highlighted region), it shows the input.
Is there a way around this?
Please and thank you in advance,
Kpark
I am currently trying to create a login screen and I have done so with 2 simple labels and 2 textboxes.
On the labels the texts were "Login ID:" and "Password:" (not important)
On the textboxes, they were just blank for user input. Their names are "ID" and "pwd"
The problem I am having is that I need to protect the password from being viewed just like you would see from logging into this website.
So, this means that any keys the user inputs into pwd textbox, it would have to appear as * for each character!
This code works fine when the user inputs a character by character or copy+paste:
Code:
Option Explicit
Private strPwd As String, lenStrPwd As Integer, lenPwd As Integer
Private Sub pwd_Change()
With LoginMenu
lenPwd = Len(.pwd.Text)
lenStrPwd = Len(strPwd)
If lenStrPwd < lenPwd Then
strPwd = strPwd & Right$(.pwd.Text, 1)
.pwd.Text = fillWAstricks(lenPwd)
Else
strPwd = Left$(strPwd, lenPwd)
End If
End With
End Sub
Private Function fillWAstricks(intChar As Integer) As String
Dim i%
For i = 1 To intChar
fillWAstricks = fillWAstricks & "*"
Next i
End Function
But when a text is highlighted and replaced with an input (without erasing the highlighted region), it shows the input.
Is there a way around this?
Please and thank you in advance,
Kpark