| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1738 人关注过本帖
标题:[求助]inputbox的返回值问题
只看楼主 加入收藏
Kert
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-1-25
收藏
 问题点数:0 回复次数:6 
[求助]inputbox的返回值问题
x=inputbox()
当什么也不输入直接点确定后,x=""
如果点了取消,x="",
那么如何判断在输入时点的是确定还是取消呢?
搜索更多相关主题的帖子: inputbox 返回值 时点 输入 
2007-01-28 21:04
dragonfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:1024
专家分:0
注 册:2006-3-20
收藏
得分:0 
InputBox
Description
Displays a prompt in a dialog box, waits for the user to input text or click a button, and returns the contents of the text box.

Syntax
InputBox(prompt[, title][, default][, xpos][, ypos][, helpfile, context])

The InputBox syntax has these arguments:

Part Description
prompt String expression displayed as the message in the dialog box. The maximum length of prompt is approximately 1024 characters, depending on the width of the characters used. If prompt consists of more than one line, you can separate the lines using a carriage return character (Chr(13)), a linefeed character (Chr(10)), or carriage return–linefeed character combination (Chr(13) & Chr(10)) between each line.
title String expression displayed in the title bar of the dialog box. If you omit title, the application name is placed in the title bar.
default String expression displayed in the text box as the default response if no other input is provided. If you omit default, the text box is displayed empty.
xpos Numeric expression that specifies, in twips, the horizontal distance of the left edge of the dialog box from the left edge of the screen. If xpos is omitted, the dialog box is horizontally centered.
ypos Numeric expression that specifies, in twips, the vertical distance of the upper edge of the dialog box from the top of the screen. If ypos is omitted, the dialog box is vertically positioned approximately one-third of the way down the screen.
helpfile Not Supported
context Not Supported.


Remarks
If the user clicks OK or presses ENTER, the InputBoxreturns whatever is in the text box. If the user clicks Cancel, thereturns a zero-length string ("").


2007-01-29 09:42
清澂居士
Rank: 6Rank: 6
等 级:贵宾
威 望:28
帖 子:1237
专家分:7
注 册:2006-12-19
收藏
得分:0 
InputBox(prompt[, title][, default][, xpos][, ypos][, helpfile, context])

INPUTBOX(文字提示,標題,默認按鈕焦點,X坐標,Y坐標,幫助文件,???)

這是我的理解``

佛曰:\"前世的500次回眸才换来今生的一次擦肩而过\".我宁愿用来世的一次擦肩而过来换得今生的500次回眸.
2007-01-29 10:48
dragonfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:1024
专家分:0
注 册:2006-3-20
收藏
得分:0 
Remarks
If the user clicks OK or presses ENTER, the InputBoxreturns whatever is in the text box. If the user clicks Cancel, thereturns a zero-length string ("").

2007-01-29 11:58
清澂居士
Rank: 6Rank: 6
等 级:贵宾
威 望:28
帖 子:1237
专家分:7
注 册:2006-12-19
收藏
得分:0 
If the user clicks OK or presses ENTER, the InputBox Returns whatever is in the text box. If the user clicks Cancel, The Returns a zero-length string ("").

懷疑樓上是復製別人的``````

佛曰:\"前世的500次回眸才换来今生的一次擦肩而过\".我宁愿用来世的一次擦肩而过来换得今生的500次回眸.
2007-01-29 12:02
dragonfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:1024
专家分:0
注 册:2006-3-20
收藏
得分:0 
晕倒!
当然是复制MSDN的了!
按Ok或者Enter,返回输入框中的内容,按Cancel返回"",要区分返回的""是输入框中的内容还是由于按Cancel而返回的,就要设置默认输入不能为空,否则无法判断!
另外三楼的理解有些小问题:default是默认输入
eg:
if InputBox("请输入:",,"0")<>"" then
...

[此贴子已经被作者于2007-1-29 12:10:38编辑过]


2007-01-29 12:10
清澂居士
Rank: 6Rank: 6
等 级:贵宾
威 望:28
帖 子:1237
专家分:7
注 册:2006-12-19
收藏
得分:0 
我的英語經常不及格滴```西西

佛曰:\"前世的500次回眸才换来今生的一次擦肩而过\".我宁愿用来世的一次擦肩而过来换得今生的500次回眸.
2007-01-29 13:20
快速回复:[求助]inputbox的返回值问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026713 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved