473,498 Members | 310 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to detect the input box is cancelled

How do I know the use click the cancel button on the input box ?
Nov 20 '05 #1
9 11014
Hello, Alan:

InputBox returns 'Nothing' if the Cancel button is pressed:

dim a as string
a=inputbox("Write something or press Cancel")
if a is nothing then
msgbox("The user pressed Cancel.")
else
'Do something with a.
end if
Regards.
"Alan" <NO**************@yahoo.com.au> escribió en el mensaje news:%2****************@tk2msftngp13.phx.gbl...
| How do I know the use click the cancel button on the input box ?
|
|
Nov 20 '05 #2
So 'nothing' is keyword ?

"Jos?Manuel Agüero" <jmªgue®ø@v°daƒøne.e?> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello, Alan:

InputBox returns 'Nothing' if the Cancel button is pressed:

dim a as string
a=inputbox("Write something or press Cancel")
if a is nothing then
msgbox("The user pressed Cancel.")
else
'Do something with a.
end if


Nov 20 '05 #3
> So 'nothing' is keyword ?

Yes, without the quotes.

Regards.
Nov 20 '05 #4
"Alan" <NO**************@yahoo.com.au> schrieb
How do I know the use click the cancel button on the input box ?


An empty string is returned:

dim s as string
s = inputbox(...)
if s.length = "" then
'cancel pressed or no input
else
'
end if
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5
Thank you !

"Armin Zingler" <az*******@freenet.de> wrote in message
news:eZ**************@TK2MSFTNGP12.phx.gbl...
"Alan" <NO**************@yahoo.com.au> schrieb
How do I know the use click the cancel button on the input box ?


An empty string is returned:

dim s as string
s = inputbox(...)
if s.length = "" then
'cancel pressed or no input
else
'
end if
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6
* José Manuel Agüero <jmªgue®ø@v°daƒøne.e§> scripsit:
InputBox returns 'Nothing' if the Cancel button is pressed:

dim a as string
a=inputbox("Write something or press Cancel")
if a is nothing then
msgbox("The user pressed Cancel.")
else
'Do something with a.
end if


The documentation says that it returns "" if it's cancelled.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
OK, I mistaked the function. InputBox returns "" if cancelled, but...
String.Length is an Integer, you should write:

If s="" Then

Or

If s.length=0 Then

Regards... and sorry for my mistake :(
"Armin Zingler" <az*******@freenet.de> escribió en el mensaje news:eZ**************@TK2MSFTNGP12.phx.gbl...
| "Alan" <NO**************@yahoo.com.au> schrieb
| > How do I know the use click the cancel button on the input box ?
|
| An empty string is returned:
|
| dim s as string
| s = inputbox(...)
| if s.length = "" then
| 'cancel pressed or no input
| else
| '
| end if
|
|
| --
| Armin
|
| http://www.plig.net/nnq/nquote.html
| http://www.netmeister.org/news/learn2quote.html
|
Nov 20 '05 #8
* José Manuel Agüero <jmªgue®ø@v°daƒøne.e§> scripsit:
OK, I mistaked the function. InputBox returns "" if cancelled, but...
String.Length is an Integer, you should write:

If s="" Then

Or

If s.length=0 Then
ACK.
Regards... and sorry for my mistake :(


No problem...

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #9
"José Manuel Agüero" <jmªgue®ø@v°daføne.e§> schrieb
OK, I mistaked the function. InputBox returns "" if cancelled,
but... String.Length is an Integer, you should write:

If s="" Then

Or

If s.length=0 Then

Regards... and sorry for my mistake :(


And sorry for _my_ mistake. :-(( *argh* *gnrrrr*
--
Armin

Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
17237
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would...
4
302
by: Derek Strickland | last post by:
Hello world I have a console application that loads several classes. I would like on of my classes to be able to detect input made in the console and take action based on the input. Sounds...
2
1699
by: marconi | last post by:
how can i do select function with time out and exit if no input is press? thanks -- Posted via http://dbforums.com
1
2121
by: Chris | last post by:
Hi, I need to be able to detect when a drag is cancelled after it has started. Meaning: after the drag operation has begun, and the user does not complete the drag, but releases whatever's being...
3
1713
by: Chandra | last post by:
What happens to a cancelled http request from the server perspective? Here's the scenario. I request a page from the web server and page requires lot of processing. Before the response comes...
2
23714
by: Dan D | last post by:
I have a large install file (an exe) on my web server that people download and install from. Looking at my log files, I see a lot of people downloading it, but no way to tell for sure if they...
3
1749
by: Joly me | last post by:
Hello to all How can differ between the input text in JAVA program . I mean that if I want my program accepts english or arabic word. Is there any encoding can know that ? I think that I...
4
1879
by: sid | last post by:
Can someone tell me how to detect "Action Cancelled" page with out polling. I have a frame set and I want to make sure the other frame is displaying what it is supposed to without polling. For...
5
2491
by: AMBLY | last post by:
Hi everyone! Could someone help me with this, please? I run Access2000 on XP Have created a Report. Have placed a button on a form to email the report Works fine - email is generated, ready...
0
6998
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
4904
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4586
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.