Solved

Vb.Net - Input Box

Posted on 2013-06-12
4
340 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 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 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