input box

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Aug 2006
Posts: 29
Reputation: stan yost is an unknown quantity at this point 
Solved Threads: 0
stan yost stan yost is offline Offline
Light Poster

input box

 
0
  #1
Sep 12th, 2006
I have an input box in my program and I want to be able to control the flow when the 'cancel' button is pushed. Any help would be appreciated.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: input box

 
0
  #2
Sep 12th, 2006
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. retval = inputbox("type stuff")
  2. if retval = "" then
  3. ' /* Cancel Pushed, Or Left Blank */
  4. msgbox "You Entered Nothing..."
  5. else
  6. ' /* They Typed Stuff */
  7. msgbox retval
  8. end if
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 29
Reputation: stan yost is an unknown quantity at this point 
Solved Threads: 0
stan yost stan yost is offline Offline
Light Poster

Re: input box

 
0
  #3
Sep 12th, 2006
Originally Posted by Comatose View Post
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. retval = inputbox("type stuff")
  2. if retval = "" then
  3. ' /* Cancel Pushed, Or Left Blank */
  4. msgbox "You Entered Nothing..."
  5. else
  6. ' /* They Typed Stuff */
  7. msgbox retval
  8. end if
The message box has two buttons - 'OK' and 'Cancel'. How do I access the flow from the 'Cancel' button. Thanks
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 29
Reputation: stan yost is an unknown quantity at this point 
Solved Threads: 0
stan yost stan yost is offline Offline
Light Poster

Re: input box

 
0
  #4
Sep 13th, 2006
Originally Posted by stan yost View Post
The message box has two buttons - 'OK' and 'Cancel'. How do I access the flow from the 'Cancel' button. Thanks
Guess I need to be told twice. Thanks!
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,117
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 282
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: input box

 
0
  #5
Sep 13th, 2006
Get the return value from the msgbox call. It returns the button value pressed.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: input box

 
0
  #6
Sep 13th, 2006
In the code I posted, retval (the variable) will be blank if the user pressed cancel. Hence the code:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. if retval = "" then
  2. ' /* Cancel Pushed, Or Left Blank */
  3. msgbox "You Entered Nothing..."
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 1
Reputation: lanze12 is an unknown quantity at this point 
Solved Threads: 0
lanze12 lanze12 is offline Offline
Newbie Poster
 
0
  #7
Oct 14th, 2009
how can i change inputbox default button, OK and CANCEL to

YES, NO and CANCEL????


cAn yOu hElp mE guyZ.....
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC