What I want is, the application that i've developed will be used by a number of users. the first three letters of the masked text box shows the code of the user. The application gets the code of the user when the user first logs in (From Username & Password). Thus, once the system recognizes the specific user, it will insert the user code on the first part of the masked text box. Therefore, the user is not asked to insert his/her code every time they logs in.What I want to do is this.
If this is not clear, i'm more than happy to elaborate it again.
Thanks,
That makes sense. And sounds like what I described. For me, when I read the shutdown time property I stick it in the masked text box's .Text property. You'll do the same when you read/receive/calculate the user code based on their Username and Password.
If your Username is "ClintXYZ" and your code is the last three letters of the username then after you get the user to log in set the text of the maskedtextbox, something like this...
myMaskedTextBox.Text = szUsername.substring(szUsername.length-4,3);
The reason for the -4 is because the string itself is zero-based, so for the X which is the 6th character it is in position 5 of the string.
How you calculate your 3 digit code is up to you. This is just for concept.
Another approach would be to not worry about putting the usercode into the text box. After all, do you really need to? You already know what the usercode is. So let the user input everything else, then combine the known usercode to the userinput before you do something with it.