input.gif (838 bytes)

Exclamtiub.gif (188 bytes) Input boxes are used to get information from the user, when you dont have room on your form, or if you just like using input boxes.

 

X = InputBox(Prompt, Title, Default Value)

!.gif (145 bytes)  X variable is a string, and now holds what the user inputs.


Sample Code

FavSite = InputBox("Enter your favorite site!", "nauts-crib.com example", "http://www.nauts-crib.com/")

Prompt
Title
Default Value

You should end up with this:

inputbox.GIF (1917 bytes)

!.gif (145 bytes) If the user leaves the input blank, vb will store it was ""


adding.gif (1136 bytes)

Exclamtiub.gif (188 bytes) Like the message box, you can add new lines
in your prompt, with the call

VbNewLine


Yes, thats the call, you would use it like this..:

X = InputBox("Hey" & vbNewLine & "Guys" & vbNewLine & "Wassup?","nauts-crib.com","")

You should end up with something like this..:

imput_2.gif (1636 bytes)


how.gif (1937 bytes)

FavSite = InputBox("Enter your favorite site!", "nauts-crib.com example", "http://www.nauts-crib.com/")
Call Msgbox(
"The user picked..." & FavSite & "!",vbInformation,"nauts-crib.com")

The Break Down

1. We set our input box to the variable FavSite, FavSite, now holds the value of what the user enters into our little box.
2. We set up a message box to tell the user what he/she picked, with an information picture.

 

VB_back.gif (1347 bytes)

1999-2000 © Erik Helgesen All Rights Reserved.
Only permitted Images and Material may be downloaded from this web site. 
PhotoShop, Flash, and Microsoft Visual Basic are registered trademarks!