Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input Box Cancel 1

Status
Not open for further replies.

hojo

Computer
Oct 9, 2002
18
Hello All,

I have an application that requests an input from the user via an InputBox function.

Trouble is that the users response can legitamatly be an empty string, but if the user presses the cancel button the method should abort.

The cancel button of an Input box returns an empty string so how can i tell whether the user pressed the OK button with an empty input field or if they pressed the cancel button.

Thanks in advance for any advice.

cheers,

Hojo

Every time i learn something new it pushes some old stuff out of my brain.
 
Replies continue below

Recommended for you

Easiest way is to create a small modal form of your own to replace the InputBox - you then have full control of functionality

Good Luck
johnwm
________________________________________________________
To get the best from these forums read faq731-376 before posting

Steam Engine enthusiasts:
 
You could also think of cancel as a shortcut to entering empty string. I only use the InputBox when I expect something other than an empty string. If you need cancel to stop your program from continuing then use johnwm's suggestion and create your own form.

Regards,

Regg
 
Thanks Johnwm

I've put this into practise.

Regards,

Hojo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top