Solved

Vb.Net - Input Box

Posted on 2013-06-12
4
332 Views
Last Modified: 2013-06-12
Good Day Experts!

I have an inquiry about using the InputBox in VB.Net.  It comes pre-populated with the Ok and Cancel buttons.  All the examples I have found for determining that the Cancel button was clicked is based off of nothing being typed in and Ok clicked if something was typed in.  

How can I determine which button was actually clicked in the event the User entered something and then wanted to Cancel?

Thanks,
jimbo99999
0
Comment
Question by:Jimbo99999
4 Comments
 
LVL 74

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 167 total points
ID: 39241001
You'll need to create your own input box in order to know this. The InputBox method only returns a string, and it does not give you any access to the underlying form that is displayed. It is unlike the MsgBox method that returns a DialogResult which you can interrogate for a user's action.
0
 
LVL 42

Assisted Solution

by:sedgwick
sedgwick earned 166 total points
ID: 39241012
long story short u can't.
InputBox is something derived from VB6 so you better use custom dialog box which u implement yourself and can handle any button u decide.
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 167 total points
ID: 39241480
Agreed.  There were hacks available in VB6 that allowed you to differentiate, but those do not work in VB.Net due to the new architecture.

Build your own "input dialog"...
0
 

Author Closing Comment

by:Jimbo99999
ID: 39242021
Thanks everyone...I better get to work.

jimbo99999
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now