Link to home
Start Free TrialLog in
Avatar of dougr
dougr

asked on

Controlling Size of VB5 InputBox

In VB5 the InputBox Function will allow you to display a Title, a Prompt, a Default response, and a screen position.
Is it also possible to control the Height and Width of the InputBox and the Width of the Text Box?

Sample Code:
 
  Title$ = "USER INPUT"
  Prompt$ = "Enter a Number From 1 to 9"
  Default$ = "1"
  X = 1000
  Y = 1000
  Entry = InputBox(Prompt$, Title$, Default$, X, Y)
 
When this is executed, an input box appears on the screen which is much larger than I would like.  The text box where the user is supposed to enter a number from 1 to 9 is wide enough for a 50 digit number!  Is there any way to make it smaller?  Also is there any way to change the font in the Title, Prompt or Text Box?

If these changes are not possible, then does anyone have some code to simulate this input box in a way that these properties (height, width, textbox width and font) can be controlled?
Avatar of marti
marti

You could just create a small VB form to get this done.
marti is right, InputBox is a simple solution, but not a very flexible one. If you want something more then it can provide you, you must create your own form
ASKER CERTIFIED SOLUTION
Avatar of cymbolic
cymbolic

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dougr

ASKER

cymbolic

I am a relative newcomer to Visual Basic, so what is a "trivial task" for some is somewhat more daunting for me.

Just so I am clear on what you are saying, I gather that it is impossible to:
  1. Change the size of an InputBox
  2. Change the Text Box width (of an InputBox)
  3. Change the Font within the text Box (of an InputBox)

Re creating a small VB Form, I still haven't mastered multiple forms - e.g. how to open several at once, how to handle mouse activity outside the form, which is front and back etc.

The solution I tend to use is to create a frame containing controls which simulate an InputBox (heading, buttons, labels etc).  I just render it visible when I need it and invisible when I don't

It takes a bit of code to do this, so I just thought there might be a more elegant solution - perhaps API's.  

dougr
Avatar of dougr

ASKER

cymbolic

I am a relative newcomer to Visual Basic, so what is a "trivial task" for some is somewhat more daunting for me.

Just so I am clear on what you are saying, I gather that it is impossible to:
  1. Change the size of an InputBox
  2. Change the Text Box width (of an InputBox)
  3. Change the Font within the text Box (of an InputBox)

Re creating a small VB Form, I still haven't mastered multiple forms - e.g. how to open several at once, how to handle mouse activity outside the form, which is front and back etc.

The solution I tend to use is to create a frame containing controls which simulate an InputBox (heading, buttons, labels etc).  I just render it visible when I need it and invisible when I don't

It takes a bit of code to do this, so I just thought there might be a more elegant solution - perhaps API's.  

dougr
Avatar of dougr

ASKER

Sorry, I got an error message from Experts Exchange when I submitted my comment, so I submitted it again.  That's why it appears twice.

dougr