⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vbs121.htm

📁 VBScript 是一种脚本语言
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML><HEAD><TITLE>InputBox Function</TITLE> 
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="PRODUCT" CONTENT="Visual Basic Scripting Edition">
<META NAME="TECHNOLOGY" CONTENT="SCRIPTING">
<META NAME="CATEGORY" CONTENT="Language Reference">

<META NAME="Keywords" CONTENT="InputBox function,modal forms,entering text,text entering,displaying prompts,displaying messages,prompts displaying,messages displaying,creating dialog boxes,dialog boxes creating,text,prompts,messages,dialog boxes"><META NAME="Description" CONTENT="InputBox Function"></HEAD><BODY BGCOLOR=FFFFFF LINK=#0033CC>
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->
<FONT FACE="Verdana, Arial, Helvetica" SIZE=2>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR VALIGN=TOP><TD WIDTH=360>
<FONT SIZE=1 COLOR=#660033>Microsoft&#174; Visual Basic&#174; Scripting Edition</FONT><BR>
<FONT SIZE=5 COLOR=#660033><B>InputBox Function</B></FONT>

</TD>
<TD ALIGN=RIGHT>
<FONT SIZE=2>&nbsp;<A HREF="vbstoc.htm">Language&nbsp;Reference</A>&nbsp;<BR>
<A HREF="vbs16.htm">Version&nbsp;1</A>&nbsp;<P></FONT>
</TD></TR>
</TABLE> 
<FONT SIZE=2><P>
<A HREF="vbs122.htm">See Also</A></FONT>
<HR noshade SIZE=1>

<H5>Description</H5>
<BLOCKQUOTE>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.</BLOCKQUOTE>

<H5>Syntax</H5>
<BLOCKQUOTE><b>InputBox(</b><i>prompt</i>[<b>, </b><i>title</i>][<b>, </b><i>default</i>][<b>, </b><i>xpos</i>][<b>, </b><i>ypos</i>][<b>, </b><i>helpfile</i><b>, </b><i>context</i>]<b>)</b><P>
The <b>InputBox</b> function syntax has these arguments:<P>
<TABLE WIDTH=87% BORDER=1 CELLPADDING=5 CELLSPACING=0>
<TR VALIGN=TOP BGCOLOR="#DDDDDD">
<TD><FONT SIZE=2><b>Part</b></FONT></TD>
<TD><FONT SIZE=2><b>Description</b></FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>prompt</i></FONT></TD>
<TD><FONT SIZE=2><A HREF="vbs0.htm#defStringExpression">String expression</A> displayed as the message in the dialog box. The maximum length of <i>prompt</i> is approximately 1024 characters, depending on the width of the characters used. If <i>prompt</i> consists of more than one line, you can separate the lines using a carriage return character (<b>Chr(</b>13<b>)</b>), a linefeed character (<b>Chr(</b>10<b>)</b>), or carriage return&#150;linefeed character combination (<b>Chr(</b>13<b>) & Chr(</b>10<b>)</b>) between each line.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>title</i></FONT></TD>
<TD><FONT SIZE=2>String expression displayed in the title bar of the dialog box. If you omit <i>title</i>, the application name is placed in the title bar.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>default</i></FONT></TD>
<TD><FONT SIZE=2>String expression displayed in the text box as the default response if no other input is provided. If you omit <i>default</i>, the text box is displayed empty.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>xpos</i></FONT></TD>
<TD><FONT SIZE=2><A HREF="vbs0.htm#defNumericExpression">Numeric expression</A> that specifies, in twips, the horizontal distance of the left edge of the dialog box from the left edge of the screen. If <i>xpos</i> is omitted, the dialog box is horizontally centered.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>ypos</i></FONT></TD>
<TD><FONT SIZE=2>Numeric expression that specifies, in twips, the vertical distance of the upper edge of the dialog box from the top of the screen. If <i>ypos</i> is omitted, the dialog box is vertically positioned approximately one-third of the way down the screen.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>helpfile</i></FONT></TD>
<TD><FONT SIZE=2>String expression that identifies the Help file to use to provide context-sensitive Help for the dialog box. If <i>helpfile</i> is provided, <i>context</i> must also be provided.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>context</i></FONT></TD>
<TD><FONT SIZE=2>Numeric expression that identifies the Help context number assigned by the Help author to the appropriate Help topic. If <i>context</i> is provided, <i>helpfile</i> must also be provided.</FONT></TD></TR></TABLE></BLOCKQUOTE>

<H5>Remarks</H5>
<BLOCKQUOTE>When both <i>helpfile</i> and <i>context</i> are supplied, a Help button is automatically added to the dialog box.<P>
If the user clicks <B>OK</B> or presses <B>ENTER</B>, the <b>InputBox</b> function returns whatever is in the text box. If the user clicks <B>Cancel</B>, the function returns a zero-length string (&quot;&quot;).</BLOCKQUOTE>
<hr noshade size=1>
<p align=center><em><a href="../../common/colegal.htm">&copy; 1997 by Microsoft Corporation. All rights reserved.</a></em></p> 

</FONT></BODY></HTML>




















































































⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -