- InputBox Function
- The InputBox function displays a dialog box containing a label, which prompts the user about the data you expect them to input, a text box for entering the data, an OK button, a Cancel button, and optionally, a Help button. When the user clicks OK, the function returns the contents of the text box.
- InputBox(Prompt, Title, Default, Xpos, Ypos, HelpFile, Context)
- MsgBox Function
- Displays a dialog box containing a message, buttons, and optional icon to the user. The action taken by the user is returned by the function as an integer value.
o InPutBox
- Syntax
- InputBox(prompt,title,default,xpos, ypos, helpfile, context)
- Description
- Prompt: The message in the dialog box.
- Title :The title-bar of the dialog box.
- Default : String to be displayed in the text box on loading.
- Xpos : The distance from the left side of the screen to the left side of the dialog.
- Ypos : The distance from the top of the screen to the top of the dialog box.
- Helpfile : The Help file to use if the user clicks the Help button on the dialog box.
- Context : The context number to use within the Help file specified in helpfile.
o InputBox - demo
- Example:
o YourName=InputBox("What's Your Name","Name Box", "MyName")
o MsgBox YourName
o MyAddress = InputBox("Enter your Address", , "Something", , , "help.hlp", 321321)
o MsgBox MyAddress
- Example:
o Option Explicit
o Dim sPrompt, sTitle, sHelpFile, sRes
o Dim vDef
o Dim nYPos, nXPos, nContext
o sPrompt = "Where do you live?" : sTitle = "Personal Data"
o vDef = "INDIA"
o nXPos = 100 : nYPos = 100 : nContext = 1001
o sHelpFile = "C:\WINDOWS\system32\winhelp.hlp"
o sRes = InputBox(sPrompt, sTitle, vDef, nXPos, nYPos, sHelpFile, nContext)
o MsgBox sRes
0 comments:
Post a Comment