Hey
I'm wondering if there is a way to change between subs?
Well I know there is a way but how?
I was just ditsing around the other day with arrays and colors when I came accross button clicking.. happening.. stuff.
I made a little log in thing, and it went as follows
LOGIN
Username
<textbox>
<button>
and the <button> and <textbox> are textboxes in Visual Basic and stuff.
You enter the username into the text box and then press the button where username (label2) changes to "Password" and you have to enter the correct password into the now blank textbox.
Only thing is, I want you to have to press the button twice, once to change to password and once again to complete the login..
I have two buttons on top of each other, and one is invisible that I can be made visible later and the other one invisible so.. you press the button twice and preform different acctions. But really your pressing two different buttons. I know this is lame and crude but I dunno anything and i'm using all my brain power here
I'm not sure if your with me here but what I have so for is like.. well I'm on a dif computer so I'm going to do a ROUGH draft of my code.
Private sub button1_click (handled by blah blah blah...)
if textbox1.text = "X-Corp" then goto password
if textbox1.text <> "X-Corp" then goto wrong
wrong:
\\ This isn't part of the coding but, label1 is the "Login" at the top of my form
label1.text = "Incorrect!"
application.doevents()
system.threading.thread.sleep(2000)
me.close()
password:
button1.visible = false
button2.visible = true
label2.text = "Password"
textbox1.text = ""
\\ NOW THIS IS WHERE I WANNA CHANGE TO MY BUTTON 2 SUB
end sub
private sub button2_click (handled by blah blah blah..)
if textbox1.text = "ritb" then goto logincorrect
if textbox1.text <> "ritb" then goto wrong
wrong:
label1.text = "Incorrect!"
application.doevents()
system.threading.thread.sleep(2000)
me.close()
logincorrect:
label1.text = "Login Successfull!"
application.doevents()
system.threading.thread.sleep (2000)
goto menu
menu:
\\ What I wanna do with my programm and stuff.. menu.. do this.. do that blah blah.
Now I know my coding is very "Streight" forward and not using any smart stuff, it's not EXACTLY like i have in my program. I can't access the file right now.
Anywho - I hope you got the jist of what I"m asking.
How to switch to another sub!!
That was quite a simple question brought into huge format and I aplogize.
I'm 13 years old.... And Not the smartest one in the box
Any help would be appriciated!!
I'm wondering if there is a way to change between subs?
Well I know there is a way but how?
I was just ditsing around the other day with arrays and colors when I came accross button clicking.. happening.. stuff.
I made a little log in thing, and it went as follows
LOGIN
Username
<textbox>
<button>
and the <button> and <textbox> are textboxes in Visual Basic and stuff.
You enter the username into the text box and then press the button where username (label2) changes to "Password" and you have to enter the correct password into the now blank textbox.
Only thing is, I want you to have to press the button twice, once to change to password and once again to complete the login..
I have two buttons on top of each other, and one is invisible that I can be made visible later and the other one invisible so.. you press the button twice and preform different acctions. But really your pressing two different buttons. I know this is lame and crude but I dunno anything and i'm using all my brain power here
I'm not sure if your with me here but what I have so for is like.. well I'm on a dif computer so I'm going to do a ROUGH draft of my code.
Private sub button1_click (handled by blah blah blah...)
if textbox1.text = "X-Corp" then goto password
if textbox1.text <> "X-Corp" then goto wrong
wrong:
\\ This isn't part of the coding but, label1 is the "Login" at the top of my form
label1.text = "Incorrect!"
application.doevents()
system.threading.thread.sleep(2000)
me.close()
password:
button1.visible = false
button2.visible = true
label2.text = "Password"
textbox1.text = ""
\\ NOW THIS IS WHERE I WANNA CHANGE TO MY BUTTON 2 SUB
end sub
private sub button2_click (handled by blah blah blah..)
if textbox1.text = "ritb" then goto logincorrect
if textbox1.text <> "ritb" then goto wrong
wrong:
label1.text = "Incorrect!"
application.doevents()
system.threading.thread.sleep(2000)
me.close()
logincorrect:
label1.text = "Login Successfull!"
application.doevents()
system.threading.thread.sleep (2000)
goto menu
menu:
\\ What I wanna do with my programm and stuff.. menu.. do this.. do that blah blah.
Now I know my coding is very "Streight" forward and not using any smart stuff, it's not EXACTLY like i have in my program. I can't access the file right now.
Anywho - I hope you got the jist of what I"m asking.
How to switch to another sub!!
That was quite a simple question brought into huge format and I aplogize.
I'm 13 years old.... And Not the smartest one in the box
Any help would be appriciated!!
Last edited: