InputBox

文字列の入力を求める入力ボックスを表示します。

InputBoxObj := InputBox(Prompt, Title, Options, Default)

パラメータ

Prompt

型:文字列

If blank or omitted, it defaults to no text. Otherwise, specify the text, which is usually a message to the user indicating what kind of input is expected. Promptが長い場合、継続セクションによっていくつかの短い行に分割することができ、読みやすさや保守性を向上させることができるかもしれません。

タイトル

型:文字列

省略された場合、A_ScriptNameの現在の値がデフォルトとなります。Otherwise, specify the title of the input box.

Options

型:文字列

If blank or omitted, the input box will be centered horizontally and vertically on the screen, with a default size of about 380x200 pixels, depending on the OS version and theme. Otherwise, specify a string of one or more of the following options, each separated from the next with a space or tab:

Xn and Yn:The X and Y coordinates of the dialog. For example, x0 y0 puts the window at the upper left corner of the desktop. どちらかの座標が省略された場合、ダイアログはその次元で中央に配置されます。どちらかの座標をマイナスにすると、ダイアログをデスクトップの一部または全部に配置することができます(マルチモニター環境ではセカンダリーモニターに配置)。

Wn および Hn:The width and height of the dialog's client area, which excludes the title bar and borders. For example, w200 h100.

Tn:Specifies the timeout in seconds. For example, T10.0 is ten seconds. この値が2147483(24.8日)を超えた場合、2147483に設定されます。After the timeout has elapsed, the input box will be automatically closed and InputBoxObj.Result will be set to the word Timeout. InputBoxObj.Value will still contain what the user entered.

Password: Hides the user's input (such as for password entry) by substituting masking characters for what the user types. If a non-default masking character is desired, include it immediately after the word Password. For example, Password* would make the masking character an asterisk rather than the black circle (bullet).

デフォルト

型:文字列

If blank or omitted, it defaults to no string. Otherwise, specify a string that will appear in the input box's edit field when the dialog first appears. ユーザーがバックスペースなどで変更することが可能です。

戻り値

型:Object

この関数は、以下のプロパティを持つオブジェクトを返します:

備考

インプットボックスは通常このような形をしています:

InputBox

ダイアログでは、テキストを入力し、OKまたはCANCELを押すことができます。ユーザーは、ダイアログウィンドウの境界線をドラッグすることで、ダイアログウィンドウのサイズを変更することができます。

GUIウィンドウは、OwnDialogsオプションによってモーダル入力ボックスを表示することができる。モーダル入力ボックスは、入力ボックスが解除されるまで、ユーザーがGUIウィンドウと対話するのを防ぎます。

Gui object, MsgBox, FileSelect, DirSelect, ToolTip, InputHook

隠しパスワードの入力を許可します。

password := InputBox("(your input will be hidden)", "Enter Password", "password").value

電話番号の入力を許可します。

IB := InputBox("Please enter a phone number.", "Phone Number", "w640 h480")
if IB.Result = "Cancel"
    MsgBox "You entered '" IB.Value "' but then cancelled."
else
    MsgBox "You entered '" IB.Value "'."