INPUTBOX$: Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
m (Add _COLORCHOOSERDIALOG) |
(Add info about password box) |
||
Line 14: | Line 14: | ||
{{PageDescription}} | {{PageDescription}} | ||
* All parameters accept an empty string ('''""''') in which case system defaults are used | * All parameters accept an empty string ('''""''') in which case system defaults are used | ||
* Use message$ to specify instructions to the user | * Use {{Parameter|message$}} to specify instructions to the user | ||
* If {{Parameter|defaultInput$}} is an empty string ('''""'''), then a password box is shown, and the input is masked | |||
* The dialog box automatically becomes a modal window if the application window is visible | * The dialog box automatically becomes a modal window if the application window is visible | ||
Revision as of 23:03, 29 October 2022
The _INPUTBOX$ function displays a prompt in a dialog box, waits for the user to input text or click a button, and returns a string containing the contents of the text box. The returned string is an empty string ("") if the user cancelled.
Syntax
- result$ = _INPUTBOX$(title$, message$[, defaultInput$])
Parameters
- title$ is the dialog box title
- message$ is the message or prompt that will is displayed in the dialog box
- defaultInput$ is a string that is displayed in the text box as the default response if no other input is provided
Description
- All parameters accept an empty string ("") in which case system defaults are used
- Use message$ to specify instructions to the user
- If defaultInput$ is an empty string (""), then a password box is shown, and the input is masked
- The dialog box automatically becomes a modal window if the application window is visible
Availability
- QB64-PE v3.4 and up
Examples
- Example
- Hello, world with common dialogs
username$ = _INPUTBOX$("Hello App", "Enter your name:", "anonymous") IF username$ <> "" THEN _MESSAGEBOX "Hello App", "Hello " + username$, "info" |
See also
- _NOTIFYPOPUP
- _MESSAGEBOX
- _MESSAGEBOX (function)
- _SELECTFOLDERDIALOG$
- _COLORCHOOSERDIALOG
- _OPENFILEDIALOG$
- _SAVEFILEDIALOG$