?
Solved

Vb.Net - Input Box

Posted on 2013-06-12
4
Medium Priority
?
349 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 668 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 664 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 668 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
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.…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month8 days, 14 hours left to enroll

764 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