Library articles and tutorials
Input Box function
By James Crowley, published on 14 Jul 2001
Page 2 of 3
- Introduction
- Parameters
- Usage
Parameters
The input box function takes three main parameters:
InputBox PromptText, DialogTitle, DefaultText
The PromptText is a string containing the text to be displayed as the prompt. The DialogTitle is a string containing the text to be displayed in the dialog's title, and DefaultText is a string containing the text to be already displayed in the text box.
Related articles
Related discussion
-
ditto
by zapthedingbat (2 replies)
-
Mousewheel
by jonh (3 replies)
-
True multithread VB source code controls
by James Crowley (3 replies)
-
Rely
by Yujvendra Verma (4 replies)
-
True multithread VB source code controls
by James Crowley (3 replies)
Hi
I want to reduce the width of text box on InputBox & to change the location of the Buttons & textbox,
is it possible?
Regards
Mahesh
what i want is a login form, but i cant get it to keep focus like when you have a messagebox or inputbox open you cant click the main form, how do i do that??
Suppose they just don't put anything in the box and click OK?
Unfortunately the input box isn't all the flexible. (You can't even hide the Cancel button.) You should use a custom form, it looks neater for getting 2 pieces of info anyway.
I have a requirement whereby the program has to wait for input of userid and password . Input box works fine but I am not able to make the password as password field. is there any property in input box to achieve this
Or
I have to use something else. If so then what shud i use.
Regards
Tirthankar
Do this....
i = InputBox("Question: blahblahblah?", "Q&A")
If i = "" Then Exit Sub ' leaves sub if the variable i is null
YOUR CODE HERE
Do this....
i = InputBox("Question: blahblahblah?", "Q&A")
If i = "" Then Exit Sub ' leaves sub if the variable i is null
YOUR CODE HERE
To end it, just add the line "exit sub" to your If statement where the string = "".
What about if the user chooses Cancel?
I made a small program (guessing game) that uses the inputbox, but how would I go about ending it when they choose cancel and not get an Error?
u didn't answer it so i started a new topic:
the codes with the () do it too!
it says "statement invalid outside type block" (and i always put it in the button click...)
and when i press ok it shows me the code:
Private Sub Command1_Click() -in yellow
DocName As String -in blue
and the rest of the code is ok.....
what's the problam?
??????
the codes with the () do it too!
it says "statement invalid outside type block" (and i always put it in the button click...)
and when i press ok it shows me the code:
Private Sub Command1_Click() -in yellow
DocName As String -in blue
and the rest of the code is ok.....
what's the problam?
??????
Apologies.
DocName = InputBox "Please enter the documents title", _
"Enter Title", "Document 1"
should have been
DocName = InputBox ("Please enter the documents title", _
"Enter Title", "Document 1")
I've corrected the article.
the later codes don't work!
why?
Is there a way to protect the contents entered into an input box?
ie..place asterisks over what someone types to protect a password.
If not...how can I prompt a user for input and protect what they enter using VB script...??
anywhere you wanna dude.
you can do this:
call inputbox("Do you really wanna?")
or
strBox= inputbox("Do ya?")
or even:
savesetting("WhatDa", "Who", "Ha", inputbox("Do da Day"))
not that hard, can be used anywhere you wanna
Does the code for Input Box go in the Load Form section?