Complex Password Field, Please help

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
7 posts Page 1 of 1
Contributors
User avatar
noobcake
Member
Member
Posts: 34
Joined: Sun Mar 27, 2011 12:16 am

Hello, I am making something where you can log into it, but what i want it to do is at the start there are two text boxes, In the first one i want there to be in grey text "Username" and the second "Password". and when you click on the box to type in it, the whole text will be deleted and you will be typing, But when you are typing I want the text to be black. So when its default "Username" it will be grey but when you type it will be Black. And in the password Field I want it the same except when you type it is in Passwordchar "*". The problem I had was that when i had password char on it would make the text "password" into ******** as-well. I don't want that, i want it to be "Password" until you type.

So I want it to be like this..
Image
then this when you type in it:
Image

I want it to be like this. I don't want to have labels above the textboxes saying Enter password:
Thanks in advance :)
If i Help you +Rep cooll;

Im new to visual basic so I probly wont :P
User avatar
Bogoh67
VIP - Site Partner
VIP - Site Partner
Posts: 656
Joined: Sun Apr 18, 2010 8:20 pm

ok well
1. first off make the textboxes as in the 1st picture
2. then click the username textbox and
3. click on the events tab on the properties dialog,
4. look for mouseclick,
5. double click it and type this code
6.
Code: Select all
textbox1.text = nothing
textbox1.forecolor = black
7. then do thiis for textbox2 but make sure its on mouseclick event
8.
Code: Select all
 textbox2.text = nothing
textbox2.forecolor = black
User avatar
Napster1488
VIP - Donator
VIP - Donator
Posts: 524
Joined: Fri Jan 07, 2011 8:41 pm

Thats is really Easy...here is the Code it also includes when Typing into the Password Field then it starts to show the Password as a Dot
Code: Select all
Private Sub TextBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Click
        If TextBox1.Text = "Username" Then
            TextBox1.Text = ""
        End If
    End Sub

    Private Sub TextBox2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.Click
        If TextBox2.Text = "Password" Then
            TextBox2.Text = ""
        End If
    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        TextBox1.ForeColor = Color.Black
    End Sub

    Private Sub TextBox2_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
        If TextBox2.Text = "Password" Then

        Else
            TextBox2.ForeColor = Color.Black
            TextBox2.UseSystemPasswordChar = True
        End If
    End Sub
Change TextBox1 and 2 ForeColor to Gray and when Typing it will set it to Black with this Code...
Dont forget to give +rep if this was helpfull ;)
YouTube Downloader v3.0
Image
Image
Image
User avatar
noobcake
Member
Member
Posts: 34
Joined: Sun Mar 27, 2011 12:16 am

<3 you guys. Thanks so much :). I am new to Visual basic and i really want to get into it. :) Thanks so much.
My fake msn login is ready now :P. thanks soo much. +Rep for all :)

Spot the fake :P
Image

One more question :). I don't think its actually possible but can you make a msg box or something that looks like a message box and looks like this
Image
Because I just have a msg box that looks like that without the picture, the man and the Windows Live, Messenger 2011. Thanks guys for what you have already done :)
If i Help you +Rep cooll;

Im new to visual basic so I probly wont :P
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

Spotted! The 'Options' link is in the wrong place ^^
But, you could add a new form to your project and make it look like the message box, then when you want to show it, instead of using Show() use ShowDialog()
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
User avatar
noobcake
Member
Member
Posts: 34
Joined: Sun Mar 27, 2011 12:16 am

MrAksel wrote:
Spotted! The 'Options' link is in the wrong place ^^
But, you could add a new form to your project and make it look like the message box, then when you want to show it, instead of using Show() use ShowDialog()
Ooooo True that :P. Thanks for pointing that out and the help :).

UPDATE:
I have moved the Options :).
Thank you very much for the point about using a second form. It works exactly right now its COMPLETE! tis awesome now :P
If i Help you +Rep cooll;

Im new to visual basic so I probly wont :P
User avatar
noobcake
Member
Member
Posts: 34
Joined: Sun Mar 27, 2011 12:16 am

========== LOCKED ===============
I have locked this thread because I have got the answers I wanted, Thank you all :) cooll;
You are all angel; , You are helping me on my way to become good at Visual basic
If i Help you +Rep cooll;

Im new to visual basic so I probly wont :P
7 posts Page 1 of 1
Return to “Tutorial Requests”