borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (VB For Dummies...)Next Topic (to check column from primary key) New Topic New Poll Post Reply
AndreaVB Forum : VB General : 4 Digit Code Display
Poster Message
Micco Koi
Level: Protégé

Registered: 17-03-2009
Posts: 5

Ads by Lake Quincy Media
icon 4 Digit Code Display

Okay, Here is what I want to do, and what I want to do it with. If anyone can tell me the way to do it, I will be very happy! LoL. I can make it work in a different way, but it does not look as smooth, and takes some getting used to.

I have a form with two command buttons. One to "End" to end the program, and "Next" which I want to take a 4 digit number from a text box, and continuously add 1 to it every time I click the next button.

So, if I put 1000 in the text field, and click next, it should go to 1001. Then if I click next again, it should go to 1002 and so on.

As I said, I got it to do it, but I had to use several command buttons, labels, and so on. It looks like crap. I would also love to be able to save where I left off, and start at that number again when I reload the program.

(It's all because my son locked my cell phone, and I have to go through the WHOLE 0000-9999 codes to be able to unlock it. Babies are cool! LoL)

Thanks for any and all help!

____________________________
"I didn't lose my mind...I just sold it for crack on E-Bay

17-03-2009 at 02:56 PM
View Profile Send Email to User Show All Posts | Quote Reply
admin
Level: Administrator


Registered: 04-04-2002
Posts: 637
icon Re: 4 Digit Code Display

sounds pretty simple

cerate a form with two command buttons and a textbox
this is the VB6 code:
Option Explicit

Private Sub Command1_Click()
    Text1.Text = Format(Val(Text1.Text) + 1, "0000")
End Sub

Private Sub Command2_Click()
    SaveSetting Me.Name, "COUNTER", "VALUE", Val(Text1.Text)
    End
End Sub

Private Sub Form_Load()
    Command1.Caption = "Next >>"
    Command2.Caption = "End"
    Text1.Text = Format(GetSetting(Me.Name, "COUNTER", "VALUE", 0), "0000")
End Sub


____________________________
AndreaVB

17-03-2009 at 04:24 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
Micco Koi
Level: Protégé

Registered: 17-03-2009
Posts: 5
icon Re: 4 Digit Code Display

Thank you very much. That worked like a charm! Now to put it to use and get back into my cell phone. Thanks again!   

____________________________
"I didn't lose my mind...I just sold it for crack on E-Bay

17-03-2009 at 05:09 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : 4 Digit Code Display
Previous Topic (VB For Dummies...)Next Topic (to check column from primary key) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder