Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 input box
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
pavol




PostPosted: Thu Mar 16, 2006 5:56 pm   Post subject: input box

simple question:
is there any way to know if the Cancel button was clicked on an input box?
this is why i wanna know
code:
pass = InputBox ("Please type in your new Password", "Password")
If (the Cancel button was clicked) Then
    (don't change the password)
End If

simple but it's driving me crazy Evil or Very Mad
Sponsor
Sponsor
Sponsor
sponsor
cool dude




PostPosted: Thu Mar 16, 2006 7:38 pm   Post subject: (No subject)

this is a little example program i made for u. if u need further help just post! Smile

code:

Dim password As String
Private Sub Form_Load()
password = InputBox("Please type in your new Password", "Password")
If password = "" Then
MsgBox "The password is the same"
Else
MsgBox "The password is " & password
End If
End Sub


Hope this helps Smile
pavol




PostPosted: Thu Mar 16, 2006 8:05 pm   Post subject: (No subject)

thanks Very Happy , i knew there was a simple solution
i just thought that when cancel was pressed and something was written in the input box then the thing that was written in there still gets stored in the variable (for some strange reason)
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: