method MsgBox.Input (Prompt as String, [Title as Variant], [DefaultResponse as Variant], [Image as Variant], [X as Variant], [Y as Variant])
Displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box.

TypeDescription
Prompt as String A String expression displayed as the message in the dialog box. The Prompt parameter may includes HTML format like explained bellow.
Title as Variant A String expression displayed in the title bar of the dialog box. The Title parameter may includes HTML format like explained bellow. The FitTitle property specifies whether the MessageBox or InputBox ensures that its title/caption fits the dialog's title
DefaultResponse as Variant A string expression displayed in the text box as the default response if no other input is provided. If you omit DefaultResponse, the displayed text box is empty. 
Image as Variant A string expression that indicates the path to a picture file being displayed, or a string expression that stores a picture in encoded base64 format. Use the eximages tool to save your picture as base64 encoded format.  
X as Variant The X parameter could be a numeric or a string expression like follows:
  • If missing/omit, the dialog box is horizontally centered relative to active screen/monitor. 
  • If -1, the dialog is shown at the current cursor position ( x-coordinate ).
  • A Numeric expression that specifies, in pixels, the distance of the left edge of the dialog box from the left edge of the screen. 
  • A String expression that indicates the handle of the window to center relative to. You need to pass the handle of the window ( hWnd for /COM or Handle or hWnd for /NET ) as a string.

The FitToScreen property specifies whether the InputBox ensures that it fits the screen ( current monitor ).

Y as Variant The Y parameter could be a numeric or a string expression like follows:
  • If missing/omit, the dialog box is vertically centered relative to active screen/monitor. 
  • If -1, the dialog is shown at the current cursor position ( y-coordinate ).
  • A Numeric expression that specifies, in pixels, the distance of the upper edge of the dialog box from the top of the screen. 
  • A String expression that indicates the handle of the window to center relative to. You need to pass the handle of the window ( hWnd for /COM or Handle or hWnd for /NET ) as a string.

The FitToScreen property specifies whether the InputBox ensures that it fits the screen ( current monitor ).

ReturnDescription
StringA string expresion that indicates the string entered by the user. If the user select cancel the Input method retrieves the DefaultResponse value.
Use the Input method to let user enters text using a dialog box and two buttons OK and Cancel. Use the Button property to assign a new caption for exOK or exCancel buttons.

The following samples aligns the input box as follow ( using /COM version ):

The following samples aligns the input box as follow ( using /NET version ):

The Prompt and Title arguments support the following HTML elements:

The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