Tuesday, April 26, 2011

Predefined Dialog Boxes - Syntex 1. Inputbox(Prompt String,Diolog Title)

Syntex

1. Inputbox(Prompt String,Diolog Title)


The easiest way to add a dialog box to your application is to use a predefined dialog, because you don't have to worry about designing, loading, or showing the dialog box. However, your control over its appearance is limited. Predefined dialog boxes are always modal.
The following table lists the functions you can use to add predefined dialog boxes to your Visual Basic application.





Use this function
To do this
InputBox function
Display a command prompt in a dialog box, and return whatever is entered by the user.
MsgBox function
Display a message in a dialog box, and return a value indicating the command button was clicked by the user.






   .
   .

 Prompting for Input with InputBox


Use the InputBox function to solicit data from the user. This function displays a modal dialog box that asks the user to enter some data. The text input box prompts the user for the name of the file to open.
The following code displays the input box 


FileName = InputBox("Enter file to open:", "File Open")


Note   Remember that when you use the InputBox function, you have little control over the components of the dialog box. You can change only the text in the title bar, the command prompt displayed to the user, the position of the dialog box on the screen, and whether or not it displays a Help button.



.

No comments:

Post a Comment