NSB.InputBox: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(Created page with " NSB.INPUTBOX(function, prompt[, title[, default]]) '''Description''' NSB.InputBox presents a modal dialog which prompts the user for an input value. While it is displayed,...")
 
No edit summary
Line 18: Line 18:
REM Demonstrate NSB.InputBox
REM Demonstrate NSB.InputBox
Function Button1_onclick() 'InputBox
Function Button1_onclick() 'InputBox
   NSB.InputBox(Button6done,"What am I thinking?", "InputBox Example")
   NSB.InputBox(Button1done,"What am I thinking?", "InputBox Example")
End Function
End Function
   
   

Revision as of 13:50, 25 July 2012


NSB.INPUTBOX(function, prompt[, title[, default]])

Description

NSB.InputBox presents a modal dialog which prompts the user for an input value. While it is displayed, no other actions may be taken by the user. Unlike InputBox, this function does not halt the program: execution of the next statement will continue immediately. It will not wait for the user’s input. The advantage of this function is that title can be specified.

The function argument is the name of a subroutine or function in your program, which will be called when the control is dismissed. The prompt argument is required. It appears under the title. title is optional: if you do not specify one, the Title of the app will show. default is the initial value to show in the input field.

When the user clicks on OK or Cancel, function will be called with two parameters: the first one will be either vbOK or vbCancel, and the second one will be the value the user entered.

To dimiss an NSB.InputBox from your program instead of waiting for the user, call NSB.closeMsgBox().

Example

REM Demonstrate NSB.InputBox
Function Button1_onclick() 'InputBox
  NSB.InputBox(Button1done,"What am I thinking?", "InputBox Example")
End Function
 
Sub Button1done(result, value)
  If result=vbOK Then Text3.value=value Else Text3.value="Cancel"
End Sub

Output

(If the user clicked on OK, the value entered will show in Text3.value. If the user cancelled,)

Related Items

INPUTBOX