Solved

Vb.Net - Input Box

Posted on 2013-06-12
4
342 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 75

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 86

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

707 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